Started JWT token generation
This commit is contained in:
parent
d90dbcdc2a
commit
6782fecc0d
5 changed files with 203 additions and 9 deletions
|
|
@ -11,9 +11,12 @@ struct Credentials {
|
|||
|
||||
#[post("/login", data = "<credentials>")]
|
||||
async fn login(conn: RbDbConn, credentials: Json<Credentials>) {
|
||||
let credentials = credentials.into_inner();
|
||||
|
||||
let user = conn
|
||||
.run(move |c| verify_user(c, &credentials.username, &credentials.password))
|
||||
.await;
|
||||
user
|
||||
}
|
||||
|
||||
// /refresh
|
||||
|
|
|
|||
Reference in a new issue