# Access Denied while editing old email address confirmation

**URL:** <https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782>\
**Category:** UX\
**Created:** [October 24, 2019, 5:48am UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782 "2019-10-24T05:48:35Z")\
**Posts on this page:** 9\
**Page:** 1

## AI-generated summary

A user ([pablico](/t/-/131782/1)) reported an "Access Denied" error when trying to edit certain email confirmation templates in Discourse’s Personalization panel, specifically those related to confirming old email addresses. The error appears as a 403 and is logged with a generic "Uncaught [object Object]" message. [tshenry](/t/-/131782/2) confirmed the issue is reproducible on Meta, and [codinghorror](/t/-/131782/3) clarified that these templates are intentionally restricted for security reasons — especially for staff accounts, where both old and new emails must be confirmed during changes. [j.jaffeux](/t/-/131782/4) confirmed the restriction is coded explicitly and noted the error, while not ideal, is technically correct. [tshenry](/t/-/131782/5) referenced a prior discussion suggesting a more user-friendly error message was planned. [pablico](/t/-/131782/6) explained their intent was to clean up email subjects by removing redundant [email_prefix] brackets, not for security bypass. [codinghorror](/t/-/131782/7) reiterated that editing these templates could enable phishing, so restriction remains. [tshenry](/t/-/131782/8) suggested using the `email prefix` site setting to customize the prefix text, though [pablico](/t/-/131782/9) noted the brackets [—] persist regardless. The discussion concludes with two proposed improvements: (1) better error messaging or prevention of the error, and (2) moving the [—] brackets into the `email prefix` setting for global control.

<div class="post-metadata">

**Author:** ![pablico](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pablico/32/159477_2.png) [@pablico](https://meta.discourse.org/u/pablico)\
**Post date:** [October 24, 2019, 5:48am UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/1 "2019-10-24T05:48:35Z")

</div>

Hi there,

I think something broke on my Discourse instance while editing text entries on the Personalization panel. Any hint on how to procced would be really appreciated, since I’m not getting really any information about what’s going here.

This what I get each time I press EDIT on this entry:

 ![48%20AM](https://global.discourse-cdn.com/meta/original/3X/e/0/e065eca876c8ce948f1dc992454fe665b7096ce5.png)

Here’s what it look on the logs:

```
|message|Uncaught [object Object]|
|---|---|
|url|https:// ****** /assets/ember_jquery-82558c4b4178a5371667ae9e87d3a56c737126be9d1394ca3dfde2d3833187f|
|line|1|
|column|262400|
|window_location|https:// ****** /admin/customize/site_texts?q=email_prefix|

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [October 24, 2019, 4:08pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/2 "2019-10-24T16:08:23Z")

</div>

I can repro this here on Meta with all three of the `user_notifications.confirm_old_email` templates. We’ll definitely take a look. Thanks for reporting this!

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [October 24, 2019, 5:46pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/3 "2019-10-24T17:46:31Z")

</div>

Reminder that these confirm old email templates are not allowed to be changed for security reasons, in the case of staff accounts where both new and old email must be confirmed on email change.

For normal users only the new email has to be confirmed but that is not the case for staff.

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [October 24, 2019, 5:47pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/4 "2019-10-24T17:47:34Z")

</div>

Yes I was looking at this issue and it’s def expected:

```ruby
  def self.restricted_keys
    ['user_notifications.confirm_old_email.title',
     'user_notifications.confirm_old_email.subject_template',
     'user_notifications.confirm_old_email.text_body_template']
  end

```

Also the error message seems OK as it’s showing a 403. Could probably be more explicit, but nothing very broken here.

---

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [October 24, 2019, 6:02pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/5 "2019-10-24T18:02:03Z")

</div>

It looks like there was supposed to have been a more explicit message added at one point:

> [@Better error message for uneditable "user\_notifications.confirm\_old\_email" texts](https://meta.discourse.org/t/better-error-message-for-uneditable-user-notifications-confirm-old-email-texts/111853/4):
>
> Opened a PR slight_smile

---

<div class="post-metadata">

**Author:** ![pablico](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pablico/32/159477_2.png) [@pablico](https://meta.discourse.org/u/pablico)\
**Post date:** [October 24, 2019, 6:16pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/6 "2019-10-24T18:16:57Z")

</div>

Thank you all for the follow up.

> [@codinghorror](#):
>
> Reminder that these confirm old email templates are not allowed to be changed for security reasons, in the case of staff accounts where both new and old email must be confirmed on email change.

I’m cleaning email subjects from [email\_prefix] since the sender name is the same as site title and don’t want to have that duplicated.

Would be able to edit that entry in some way? It doesn’t seem to be a security issue for me.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [October 24, 2019, 6:53pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/7 "2019-10-24T18:53:16Z")

</div>

If edited, it potentially turns into a phishing mail so editing that one is not allowed.

---

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [October 24, 2019, 6:55pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/8 "2019-10-24T18:55:10Z")

</div>

You may already be aware, but you can edit the email prefix to be something other than the site title via the `email prefix` site setting.

---

<div class="post-metadata">

**Author:** ![pablico](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pablico/32/159477_2.png) [@pablico](https://meta.discourse.org/u/pablico)\
**Post date:** [October 24, 2019, 7:31pm UTC](https://meta.discourse.org/t/access-denied-while-editing-old-email-address-confirmation/131782/9 "2019-10-24T19:31:01Z")

</div>

Ok, thanks for the clarification. I assume your are right about that @codinghorror

> [@tshenry](#):
>
> You may already be aware, but you can edit the email prefix to be something other than the site title via the `email prefix` site setting.

Yep, I’ve seen that option but the brackets [—] are still there, even if there’s no need to add anything.

We can extract to possible outcomes from this:

1. Add a better explanation to error, or even better _prevent_ that error.
2. Move [—] inside ‘email\_prefix’ so you can manipulate it globally from settings

Thanks
