Clean up (mostly automated with cargo clippy --fix)

This commit is contained in:
Jonas Platte 2021-09-13 19:45:56 +02:00
parent 979ec6b4fa
commit d68c93b5fa
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
36 changed files with 364 additions and 393 deletions

View file

@ -100,8 +100,8 @@ pub async fn login_route(
login::IncomingLoginInfo::Token { token } => {
if let Some(jwt_decoding_key) = db.globals.jwt_decoding_key() {
let token = jsonwebtoken::decode::<Claims>(
&token,
&jwt_decoding_key,
token,
jwt_decoding_key,
&jsonwebtoken::Validation::default(),
)
.map_err(|_| Error::BadRequest(ErrorKind::InvalidUsername, "Token is invalid."))?;
@ -179,7 +179,7 @@ pub async fn logout_route(
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
let sender_device = body.sender_device.as_ref().expect("user is authenticated");
db.users.remove_device(&sender_user, sender_device)?;
db.users.remove_device(sender_user, sender_device)?;
db.flush()?;
@ -209,7 +209,7 @@ pub async fn logout_all_route(
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
for device_id in db.users.all_device_ids(sender_user).flatten() {
db.users.remove_device(&sender_user, &device_id)?;
db.users.remove_device(sender_user, &device_id)?;
}
db.flush()?;