Skip to content
Snippets Groups Projects
Commit 9385ea0e authored by reti4's avatar reti4
Browse files

fmt fix

parent 9f059ad4
No related branches found
No related tags found
No related merge requests found
...@@ -56,11 +56,11 @@ pub async fn login_route( ...@@ -56,11 +56,11 @@ pub async fn login_route(
} else { } else {
return Err(Error::BadRequest(ErrorKind::Forbidden, "Bad login type.")); return Err(Error::BadRequest(ErrorKind::Forbidden, "Bad login type."));
}; };
let user_id = let user_id = UserId::parse_with_server_name(
UserId::parse_with_server_name(username.to_lowercase().to_owned(), db.globals.server_name()) username.to_lowercase().to_owned(),
.map_err(|_| { db.globals.server_name(),
Error::BadRequest(ErrorKind::InvalidUsername, "Username is invalid.") )
})?; .map_err(|_| Error::BadRequest(ErrorKind::InvalidUsername, "Username is invalid."))?;
let hash = db.users.password_hash(&user_id)?.ok_or(Error::BadRequest( let hash = db.users.password_hash(&user_id)?.ok_or(Error::BadRequest(
ErrorKind::Forbidden, ErrorKind::Forbidden,
"Wrong username or password.", "Wrong username or password.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment