"Oops" error when clicking email link to authorize email address change

AI-generated summary

ChrisBeach reported an “Oops! That page doesn’t exist or is private” error when clicking an email authorization link to change an account’s email address. The error stems from a missing route in the application, as shown in the production.log, which logs a RoutingError for the /u/authorize-email/[token] endpoint. gerhard provided a helpful link to a related discussion on Meta Discourse that addresses the issue, possibly due to misconfigured email templates or customizations. ChrisBeach thanked gerhard for the reference. This appears to be a configuration or routing bug affecting email verification flows in Discourse, likely resolvable by reviewing email template settings or server routes.

When attempting to change the email address associated with an account, the user is emailed a link of the form https://[domain]/u/authorize-email/[some token]. When clicking on that link, the forum displays an error message “Oops! That page doesn’t exist or is private.”

From production.log:

Started GET "/u/authorize-email/[redacted]" for [redacted] at 2020-05-23 13:55:06 +0000
ActionController::RoutingError (No route matches [GET] "/u/authorize-email/[redacted]")
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.3/lib/action_dispatch/middleware/debug_exceptions.rb:36:in `call'
  Rendering exceptions/not_found.html.erb within layouts/no_ember
  Rendered exceptions/not_found.html.erb within layouts/no_ember (Duration: 1.0ms | Allocations: 517)
  Rendered layouts/_head.html.erb (Duration: 2.6ms | Allocations: 428)
  Rendered common/_discourse_stylesheet.html.erb (Duration: 1.7ms | Allocations: 665)
  Rendered application/_header.html.erb (Duration: 0.3ms | Allocations: 74)
  Rendering html template
  Rendered html template (Duration: 0.0ms | Allocations: 2)

Thanks @gerhard :+1: