There’s definitely a bug here. To refine repro steps a bit:
- Setup 2FA with TOTP
- Enable backup codes
- Change email address
- Select the verification link in the confirmation email
- Get hit with the “Oops” page
I can confirm that disabling the backup codes will immediately fix the issue, even when using the same email verification link.
Error log shows:
ActionView::Template::Error (Missing partial common/_second_factor_form_script with {:locale=>[:en_US, :en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby]}. Searched in:
* "/var/www/discourse/app/views"
)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.1/lib/action_view/path_set.rb:48:in `find'
Which I believe relates to this line here: https://github.com/discourse/discourse/blob/master/app/views/users_email/confirm.html.erb#L36
That references a file that is indeed missing: discourse/app/views/common at main · discourse/discourse · GitHub