Skip to content

Commit

Permalink
Replaced missing code
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyToor committed Nov 24, 2024
1 parent c9f82b1 commit 1d15d95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/src/api/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,17 @@ async fn login_post(
println!("Post-Cookie: {} = {}", cookie.name(), cookie.value());
}

let login_cookie = cookies
.get_private(LOGIN_COOKIE)
.and_then(|cookie| serde_json::from_str::<LoginInfo>(cookie.value()).ok())
.ok_or_else(|| AuthError::MissingLoginCookie(String::from("Unknown login session")))?;
cookies.remove_private(Cookie::named(LOGIN_COOKIE));

if state != login_cookie.csrf_state {
return Err(AuthError::CsrfMissmatch(String::from(
"Possible Cross Site Request Forgery attack detected",
)));
}
}st

Check failure on line 370 in backend/src/api/auth.rs

View workflow job for this annotation

GitHub Actions / Lint backend

expected `;`, found keyword `let`

let token_result = oauth
.exchange_code(AuthorizationCode::new(code))
Expand Down

0 comments on commit 1d15d95

Please sign in to comment.