Forward the login_hint upstream.
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1 +1,9 @@
|
|||||||
|
# Rust
|
||||||
target/
|
target/
|
||||||
|
|
||||||
|
# Editors
|
||||||
|
.idea
|
||||||
|
.nova
|
||||||
|
|
||||||
|
# OS garbage
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use hyper::StatusCode;
|
|||||||
use mas_axum_utils::{cookies::CookieJar, record_error};
|
use mas_axum_utils::{cookies::CookieJar, record_error};
|
||||||
use mas_data_model::UpstreamOAuthProvider;
|
use mas_data_model::UpstreamOAuthProvider;
|
||||||
use mas_oidc_client::requests::authorization_code::AuthorizationRequestData;
|
use mas_oidc_client::requests::authorization_code::AuthorizationRequestData;
|
||||||
use mas_router::UrlBuilder;
|
use mas_router::{PostAuthAction, UrlBuilder};
|
||||||
use mas_storage::{
|
use mas_storage::{
|
||||||
BoxClock, BoxRepository, BoxRng,
|
BoxClock, BoxRepository, BoxRng,
|
||||||
upstream_oauth2::{UpstreamOAuthProviderRepository, UpstreamOAuthSessionRepository},
|
upstream_oauth2::{UpstreamOAuthProviderRepository, UpstreamOAuthSessionRepository},
|
||||||
@@ -92,6 +92,15 @@ pub(crate) async fn get(
|
|||||||
data = data.with_response_mode(response_mode.into());
|
data = data.with_response_mode(response_mode.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forward the raw login hint upstream for the provider to handle however it sees fit
|
||||||
|
if let Some(post_auth_action) = &query.post_auth_action {
|
||||||
|
if let PostAuthAction::ContinueAuthorizationGrant { id } = post_auth_action {
|
||||||
|
if let Some(grant) = repo.oauth2_authorization_grant().lookup(*id).await? {
|
||||||
|
data.login_hint = grant.login_hint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let data = if let Some(methods) = lazy_metadata.pkce_methods().await? {
|
let data = if let Some(methods) = lazy_metadata.pkce_methods().await? {
|
||||||
data.with_code_challenge_methods_supported(methods)
|
data.with_code_challenge_methods_supported(methods)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user