cargo clippy --fix
This commit is contained in:
parent
e624453472
commit
3d925edaad
1 changed files with 2 additions and 4 deletions
|
@ -87,10 +87,8 @@ struct Login<'r> {
|
||||||
|
|
||||||
#[post("/login", data = "<login>")]
|
#[post("/login", data = "<login>")]
|
||||||
async fn post_login(login: Form<Login<'_>>, cookies: &CookieJar<'_>) -> Redirect {
|
async fn post_login(login: Form<Login<'_>>, cookies: &CookieJar<'_>) -> Redirect {
|
||||||
if login.token_type != "Bearer" || login.scope != "guilds.join+identify+guilds" {
|
if (login.token_type != "Bearer" || login.scope != "guilds.join+identify+guilds") && User::init(login.access_token, cookies).await.is_ok() {
|
||||||
if User::init(login.access_token, cookies).await.is_ok() {
|
cookies.add(Cookie::new(TOKEN_EXPIRE_COOKIE, (Utc::now() + Duration::seconds(login.expires_in as i64)).timestamp().to_string()));
|
||||||
cookies.add(Cookie::new(TOKEN_EXPIRE_COOKIE, (Utc::now() + Duration::seconds(login.expires_in as i64)).timestamp().to_string()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Redirect::to("/")
|
Redirect::to("/")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue