Some broken shit
This commit is contained in:
parent
1c524f181f
commit
d90dbcdc2a
9 changed files with 67 additions and 12 deletions
|
|
@ -1,16 +1,19 @@
|
|||
use crate::RbDbConn;
|
||||
use serde::Deserialize;
|
||||
use rb::auth::verify_user;
|
||||
use rocket::serde::json::Json;
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Credentials {
|
||||
username: String,
|
||||
password: String
|
||||
password: String,
|
||||
}
|
||||
|
||||
#[post("/login", data="<credentials>")]
|
||||
#[post("/login", data = "<credentials>")]
|
||||
async fn login(conn: RbDbConn, credentials: Json<Credentials>) {
|
||||
|
||||
let user = conn
|
||||
.run(move |c| verify_user(c, &credentials.username, &credentials.password))
|
||||
.await;
|
||||
}
|
||||
|
||||
// /refresh
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
// compilation succeeds
|
||||
extern crate openssl;
|
||||
|
||||
#[macro_use] extern crate rocket;
|
||||
#[macro_use] extern crate diesel_migrations;
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
#[macro_use]
|
||||
extern crate diesel_migrations;
|
||||
|
||||
use rocket::{fairing::AdHoc, Build, Rocket};
|
||||
use rocket_sync_db_pools::{database, diesel};
|
||||
|
|
|
|||
Reference in a new issue