Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(accounts): Only re-send verification to unverified accounts #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

9mido
Copy link
Owner

@9mido 9mido commented Jan 27, 2021

A user is able to click on the re-send verification button in /accounts/email/ which will re-send another verification email again to the already verified email address if it was previously verified. This will check to see if that email address has already been verified and prevent the re-send verification email from sending out again to those verified users.

I decided to use "A link to activate your account has been emailed to the address provided" as the error message as opposed to "This e-mail has already been verified" to stay within OWASP guidelines - see the email privacy leak issue (if we decide on using this OWASP error messaging throughout allauth).

But I suppose changing the error message to something else would be okay for this particular case (in other places though OWASP wording would be better).

If you want to allow users to create their own custom message, comment out messages.error and use:

            adapter = get_adapter(request)
            template = 'account/messages/resend_verified_error.txt'
            adapter.add_message(request,messages.INFO,template,{'email': email})

https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html

Solves pennersr#754

A user is able to click on the re-send verification in /accounts/email/ which will re-send another verification email again to the already verified email address. This will check to see if that email address has already been verified and prevent the re-send verification email from sending out again. 

I decided to use "A link to activate your account has been emailed to the address provided" as the error message as opposed to "This e-mail has already been verified" to stay within OWASP guidelines - see the email privacy leak issue (if we decide on using this OWASP error messaging throughout allauth). 

But I suppose changing the error message to something else would be okay. 

If you want to allow users to create their own custom message, comment out messages.error and use:

            adapter = get_adapter(request)
            template = 'account/messages/resend_verified_error.txt'
            adapter.add_message(request,messages.INFO,template,{'email': email})

https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant