zetkin / www.zetk.in

The main activist front-end for Zetkin.
https://www.zetk.in
4 stars 7 forks source link

Allow users to change email #291

Closed niklasva82 closed 2 years ago

niklasva82 commented 2 years ago

Allow users to change their e-mail address and display the correct conflict (phone/email) error message on sign-up page.

niklasva82 commented 2 years ago

I'm having some issues verifying a email address after it has been submitted on the settings page. If already logged in (using OTP), nothing appears to happen, and if not logged in and I log in using email/password, it redirects to /dashboard (despite not verifying) where "TypeError: Cannot read property 'size' of undefined" is display, presumable because the user is not allowed to fetch some information because they are logged in but not verified.

niklasva82 commented 2 years ago

And as I wrote that, I realized what was wrong, /verify checked for user.is_verified rather than user.email_is_verified, which means that because the phone was already verified, it would bypass the verification.

niklasva82 commented 2 years ago

I think this is done now. The one thing missing that I can think of is the ability to change the email if it already exists. I experimented with this but was not able to get optional two factor authentication to work properly on www.

niklasva82 commented 2 years ago

Alright I changed the message. It looks like this now Screenshot from 2022-06-21 15-26-25

niklasva82 commented 2 years ago

But this message should only be visible once the email has been verified however, not immediately after changing your email.