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

+4
View File
@@ -81,6 +81,10 @@ async fn route_change_email(
) -> Result {
let user_id = user.expect_recent(LoginTarget::ChangeEmail)?;
if !services.threepid.email_requirement().may_change() {
return Err(WebError::Forbidden("You may not change your email address.".to_owned()));
}
let Some(form) = form else {
return response!(ChangeEmail::new(
context.clone(),
+4 -2
View File
@@ -17,14 +17,16 @@ Your account
</p>
{% endif %}
<section>
{% if email_requirement.may_change() %}
{% if email_requirement.may_view() %}
<p>
{% if let Some(email) = email %}
Your account's associated email address is <code>{{ email }}</code>.
{% else %}
Your account has no associated email address.
{% endif %}
<a href="email/change/">Change your email</a>
{% if email_requirement.may_change() %}
<a href="email/change/">Change your email</a>\
{% endif %}
</p>
{% endif %}
{% if !oidc_enabled %}