Skip to content

Commit a5468b0

Browse files
fix: OAuth error (#934)
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
1 parent 430b55c commit a5468b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/handlers/http/oidc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub async fn login(
6363
req: HttpRequest,
6464
query: web::Query<RedirectAfterLogin>,
6565
) -> Result<HttpResponse, OIDCError> {
66-
let conn = req.connection_info();
66+
let conn = req.connection_info().clone();
6767
let base_url = format!("{}://{}/", conn.scheme(), conn.host());
6868
if !base_url.eq(query.redirect.as_str()) {
6969
return Err(OIDCError::BadRequest);

0 commit comments

Comments
 (0)