Browse Source
SSO fallback to UserInfo preferred_username (#7128)
Co-authored-by: Timshel <timshel@users.noreply.github.com>
pull/7157/head
Timshel
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
1 additions and
1 deletions
-
src/sso.rs
|
|
@ -283,7 +283,7 @@ pub async fn exchange_code( |
|
|
|
|
|
|
|
|
let email_verified = id_claims.email_verified().or(user_info.email_verified()); |
|
|
let email_verified = id_claims.email_verified().or(user_info.email_verified()); |
|
|
|
|
|
|
|
|
let user_name = id_claims.preferred_username().map(|un| un.to_string()); |
|
|
let user_name = id_claims.preferred_username().or(user_info.preferred_username()).map(|un| un.to_string()); |
|
|
|
|
|
|
|
|
let refresh_token = token_response.refresh_token().map(|t| t.secret()); |
|
|
let refresh_token = token_response.refresh_token().map(|t| t.secret()); |
|
|
if refresh_token.is_none() && CONFIG.sso_scopes_vec().contains(&"offline_access".to_string()) { |
|
|
if refresh_token.is_none() && CONFIG.sso_scopes_vec().contains(&"offline_access".to_string()) { |
|
|
|