Browse Source

Simplify claim extraction logic

Removed redundant extraction of 'name' claim from user info. The admin may wish to fall back to preferred_username, even if name exists
pull/7566/head
kittygaming99 1 week ago
committed by GitHub
parent
commit
0db744bd2f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/sso.rs

2
src/sso.rs

@ -299,8 +299,6 @@ pub async fn exchange_code(
let user_name = extract_claim(&id_claims_json, &configured_claim)
.or_else(|| extract_claim(&user_info_json, &configured_claim))
.or_else(|| extract_claim(&id_claims_json, "name"))
.or_else(|| extract_claim(&user_info_json, "name"))
.or_else(|| id_claims.preferred_username().map(|n| n.to_string()))
.or_else(|| user_info.preferred_username().map(|n| n.to_string()));

Loading…
Cancel
Save