File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
crates/handlers/src/upstream_oauth2 Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Rust
1
2
target /
3
+
4
+ # Editors
5
+ .idea
6
+ .nova
7
+
8
+ # OS garbage
9
+ .DS_Store
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use hyper::StatusCode;
12
12
use mas_axum_utils:: { cookies:: CookieJar , record_error} ;
13
13
use mas_data_model:: UpstreamOAuthProvider ;
14
14
use mas_oidc_client:: requests:: authorization_code:: AuthorizationRequestData ;
15
- use mas_router:: UrlBuilder ;
15
+ use mas_router:: { PostAuthAction , UrlBuilder } ;
16
16
use mas_storage:: {
17
17
BoxClock , BoxRepository , BoxRng ,
18
18
upstream_oauth2:: { UpstreamOAuthProviderRepository , UpstreamOAuthSessionRepository } ,
@@ -92,6 +92,15 @@ pub(crate) async fn get(
92
92
data = data. with_response_mode ( response_mode. into ( ) ) ;
93
93
}
94
94
95
+ // Forward the raw login hint upstream for the provider to handle however it sees fit
96
+ if let Some ( post_auth_action) = & query. post_auth_action {
97
+ if let PostAuthAction :: ContinueAuthorizationGrant { id } = post_auth_action {
98
+ if let Some ( grant) = repo. oauth2_authorization_grant ( ) . lookup ( * id) . await ? {
99
+ data. login_hint = grant. login_hint ;
100
+ }
101
+ }
102
+ }
103
+
95
104
let data = if let Some ( methods) = lazy_metadata. pkce_methods ( ) . await ? {
96
105
data. with_code_challenge_methods_supported ( methods)
97
106
} else {
You can’t perform that action at this time.
0 commit comments