Skip to content

Commit

Permalink
fix: OAuth error (#934)
Browse files Browse the repository at this point in the history
issue: already borrowed: BorrowMutError when try login with oauth
because of req.connection_info() which makes an immutable borrow of 
req method extract_session_key_from_req() also borrows req because of which 
the server panics with the error fix is to use connection_info().clone() to 
avoid multiple borrows
  • Loading branch information
nikhilsinhaparseable authored Sep 23, 2024
1 parent 430b55c commit a5468b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/handlers/http/oidc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub async fn login(
req: HttpRequest,
query: web::Query<RedirectAfterLogin>,
) -> Result<HttpResponse, OIDCError> {
let conn = req.connection_info();
let conn = req.connection_info().clone();
let base_url = format!("{}://{}/", conn.scheme(), conn.host());
if !base_url.eq(query.redirect.as_str()) {
return Err(OIDCError::BadRequest);
Expand Down

0 comments on commit a5468b0

Please sign in to comment.