On email address change second confirm fails due to email customization

Hi there - I searched for an answer to this issue but failed to find anything. I am an Admin on our forum and usually sign-in via Google auth. I wanted to change my email address and started that from my preferences page. The first confirm email arrived at my current email address and I confirmed - ok ok so far and it said a confirm email will be sent to the new address. The second confirm email arrives at the new address but when I click on that confirm link I get this in the browser:

Oops! That page doesnā€™t exist or is private.

The process results in my old email address still being active in my account.

2 Likes

I may be having a similar experience. I am an Admin on our forum. I changed my email address, received the verification email - okay so far. Upon going back to my forum - I get logged in automatically - I checked my settings. Forum emails are set to my new address, howeverā€¦ login email is the same as originally registered. I did some checking and found out I have to login in to my Admin account with the same address used when first registered. If I completely log out and try to log back in with my ā€œnewā€ email address, I get the same error message as you.

Check you preferences to see if your email address to receive forum emails is set to your new address. It probably is. But I bet the address for logging in is still set to the one you used when you first set up your Admin account.

Maybe @dax or another team member can explain if this how it is supposed to be or if the Admin login email has to be reset another way.

Can we repro this Monday @tshenry? It would be admin specific.

2 Likes

I tested out the admin email change process on the latest tests-passed version of Discourse. I had Google auth set up in addition to normal login credentials. I tested using two different browsers (Safari and Chrome) and all seems to be working the way I would expect it to.

I also tried on a Discourse site thatā€™s on a commit about 11 days old. This admin account had the standard login set up with 2FA enabled. The process has changed a little since this commit, but it still works fine.

If anyone continues to run into this when their Discourse site completely up to date, please post how to repro step by step along with any relevant browser details (version, OS, default browser vs. plugins installed). If you are hosted by us and this is actively happening, reach out via the usual support channel and weā€™ll work directly with you to figure out whatā€™s going on.

5 Likes

Hereā€™s what Iā€™ve done, several times:

  • Under my Dashboard, I changed my email address to a new one.
  • I received the email from the forum software, clicked on the link to verify.
  • Checking the Dashboard, my email address was changed to reflect the new one. This shows under Billing
  • My new address also receives the new topic/posts notifications.

Checking my User Preferences/Account (for logging in) still shows the original email address used when I first started the forum.

  • I edited the email address there to my new address.
  • Clicked Save Changes and excited.
  • Later on I double-checked and the original email address was showing again.

Any time I login, the login message does state to use the address used to set up Discourse. Thatā€™s why I didnā€™t bother to report it, figuring it was for security. Aside from that, my new email address does receive what itā€™s supposed to - notifications, billing receipts, etcā€¦
(I still have access to my old mailbox by the way.)

Sorry, we were not talking about hosted emails. We were talking about users (specifically admins) initiating an email change in their account via the same account edit page that all users see when they change their email.

Thatā€™s where my problem lies. I am an Admin. I canā€™t change it on that page. I go to my user account preferences, change the email address, click save, receive the notice a verification email has been sent, and exit. When I click on the link and get taken to the login screen, I enter my new email address and get a notice to login using the address used when first signing in. The email change was never saved. It back to the original address I signed up with. :neutral_face:

OTOH, if I use an email address from a different domain name I own - instead of one with the same domain name as the forum - then that would work? Either way, itā€™s not a problem for me. I can leave well enough alone.

I removed my Google auth in case that was part of the issue. For repro I recorded this 94 second screencast of my steps:

2 Likes

@David_Baker1, thanks for taking the time to put the video together. I watched it and carefully followed along on Chrome. Everything ended up working flawlessly, so there must be something unique going on in your environment. Some questions to consider:


If it ever does become a problem, feel free to send us an email and weā€™ll see if we can get things sorted for you directly. This is the first Iā€™ve heard of the issue you describe.

5 Likes

Just did the same routine on Firefox (70.0.1 64 bit) and got the same result. Answers:

  • I donā€™t have any errors logged since Nov.4
  • I tried again in Firefox
  • I have the following plugins: discourse-assign; discourse-data-explorer; discourse-plugin-linkedin-auth; discourse-solved; docker_manager
  • My instance was set-up and managed by a major contributor on this meta-site and Iā€™ve had no odd issues until this
4 Likes

Hmm, how strange! It looks like your set up is pretty standard. Iā€™ll give it one more look with a couple fresh ideas when I get a chance next week. Beyond that Iā€™m at a loss given Iā€™m unable to reproduce the issue.

3 Likes

Hi again - after more digging I found something that may hint at a cause. In my account settings/preferences my email is listed as the email address I want to change away from. But if I click on the Admin button near the top right of that view and scroll down to the bottom under SSO setting it lists the email address I want to change to. It was the address I used way back when we first set up Discourse. In the meantime I git a new job and changed the email on my account. But now I wanted to change it back.

So now it seems two different emails are associated with my account.

Could this point to the potential cause of this issue?

2 Likes

The SSO stuff shouldnā€™t matter since SSO is disabled. But that could be it.

1 Like

The email address that you are trying to update to may already be your accountā€™s ā€˜secondaryā€™ email. If that is the case, you will need to delete the secondary email address before you can update your primary email address.

As a site admin, you can confirm that the email is your secondary email address by going to your admin page and clicking the Show button for the Secondary Emails row:

Instructions for deleting a secondary email address from the Rails console are in this post: https://meta.discourse.org/t/rake-task-for-merging-users/89086/33

2 Likes

This is exactly my situation. In Admin my email shows what I wanted to change to, but in my user preferences itā€™s stuck on the original address I used to first login. I also have 2 different emails associated with my accountā€¦ or is the user and Admin considered 2 different accounts?

I just checked again. I have no secondary email account showing in the Admin Dashboard.

Just to make sure this isnā€™t the issue, are you an admin on the site? Moderators will not see the email fields unless the moderators view emails setting is enabled. It is disabled by default.

3 Likes

Yes, Iā€™m the administrator.

1 Like

I am an admin too - if this was also directed at me :slight_smile:

If you have access to the rails console for you site, you could see if the email address you are trying to update to is being used by running the following command with the email address you are trying to update to:

UserEmail.where(email: 'youremail@example.com')

If you have the Data Explorer plugin installed on your site, you can check this with a Data Explorer query instead of having to use the console.

If any results are returned, that will be the cause of the issue. Having the email address you are trying to update to exist in a Single Sign On record should not cause any issues though.

2 Likes

EDIT: Found it. user_notifications.confirm_new_email.text_body_template had overridden the URL.
You can ignore the rest.

Hey, Simon. Thanks for your help.

Hereā€™s the problem:

Itā€™s sending ā€œconfirm your new email addressā€ emails with links like https://forum.xx.org/users/authorize-email/c7ed779eb28c049ec4a5105dd9e07013 rather than https://forum.xx.org/u/confirm-new-email/c15d4bc33211e586b70572195f7dac89.

If I re-write the link to use the correct URL and the token, it works just fine, but for some reason, itā€™s sending the old link style and not the new one! (I did it twice, once after Iā€™d done the grep and reboot described below.)

I just did a ./launcher rebuild and itā€™s still sending links with the old format. As advertised, only solid, official plugins are installed.

And then I go into the container and in /var/www/discourse do a grep -r authorize-email and it finds no files. And then I rebooted.

Iā€™m pretty stumped for at least the second time in 24 hours.

3 Likes