mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-11 00:07:57 -06:00
refactor: allow testing of mocked providers via AuthRegistry creation, avoid creation of responses in auth
This commit is contained in:
@@ -46,9 +46,14 @@ pub async fn oauth_authorize_handler(
|
||||
.build(),
|
||||
);
|
||||
}
|
||||
let resp = prov.authorize(&cookie, &app_state.jwt_encoding_key).await;
|
||||
let auth_info = match prov.authorize(&app_state.jwt_encoding_key).await {
|
||||
Ok(info) => info,
|
||||
Err(e) => return e.into_response(),
|
||||
};
|
||||
|
||||
session::set_session_cookie(&cookie, &auth_info.session_token);
|
||||
trace!("Redirecting to provider authorization page");
|
||||
resp
|
||||
Redirect::to(auth_info.authorize_url.as_str()).into_response()
|
||||
}
|
||||
|
||||
pub async fn oauth_callback_handler(
|
||||
|
||||
Reference in New Issue
Block a user