fix: Properly show email in account page when OIDC email_claim is set

This commit is contained in:
Ginger committed 2026-07-02 16:57:21 -04:00
1 parent da7d8c9821
commit 514c3bbcbf
4 files changed
+19 -4

No files matched your search

+7 -2
View File
@@ -33,7 +33,9 @@ pub enum EmailRequirement {
Required,
/// Users may change or remove their email.
Optional,
/// Users may not change their email at all.
/// Users may see their email, but may not change it.
Locked,
/// Email features are disabled.
Unavailable,
}
@@ -43,6 +45,9 @@ impl EmailRequirement {
#[must_use]
pub fn may_remove(&self) -> bool { matches!(self, Self::Optional) }
#[must_use]
pub fn may_view(&self) -> bool { !matches!(self, Self::Unavailable) }
}
struct Data {
@@ -91,7 +96,7 @@ impl Service {
&& matches!(oidc.profile_key_import_mode, OidcProfileKeyImportMode::OnLogin)
&& oidc.email_claim.is_some()
{
EmailRequirement::Unavailable
EmailRequirement::Locked
} else if smtp.require_email_for_registration
|| smtp.require_email_for_token_registration
{