feat(user.prefered_locale): save user's locale + invited have same locale as inviters

- OIDC JIT define the locale only at user creation, user can so change his preference later
    - invited users will inherit inviter's locale
    - email will use prefered_locale
    - login to a new browser will use prefered_locale
This commit is contained in:
Edouard Vanbelle
2026-06-03 14:26:45 +02:00
parent 854f1d3a07
commit 7db27af7a6
14 changed files with 342 additions and 26 deletions
@@ -70,6 +70,7 @@ struct IdTokenClaims {
groups: Option<Vec<String>>,
nonce: Option<String>,
picture: Option<String>,
locale: Option<String>,
// Standard JWT fields
#[allow(dead_code)]
iss: Option<String>,
@@ -96,6 +97,7 @@ struct UserInfoResponse {
family_name: Option<String>,
groups: Option<Vec<String>>,
picture: Option<String>,
locale: Option<String>,
}
// ============================================================================
@@ -469,6 +471,7 @@ impl OidcServicePort for OidcService {
family_name: claims.family_name,
groups: claims.groups.unwrap_or_default(),
picture: claims.picture,
locale: claims.locale,
})
}
@@ -523,6 +526,7 @@ impl OidcServicePort for OidcService {
family_name: info.family_name,
groups: info.groups.unwrap_or_default(),
picture: info.picture,
locale: info.locale,
})
}