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

Add email verification feature #53

Merged
merged 1 commit into from
Jul 2, 2018

Conversation

isabelcosta
Copy link
Member

@isabelcosta isabelcosta commented Jun 21, 2018

Description

Fixes #5
Fixes #7

Add email verification consisting of:

  • Send an email to a newly registered user with a link with a token that verifies the user's email (updates is_email_verified and email_verification_date variables)
  • Uses flask_mail extension
  • Added tests to confirmation of email function on UserDAO
  • Updated swagger.json
  • Email confirmation token expires after 24 hours
  • Email sensitive info is read through environment variables
  • Updated the README informing of the necessary environment variables that should be exported
  • The user should not be able to login unless the email is verified. In the attempt to do so, should receive a message saying Please confirm your email - Sent on PR Integrate flask-jwt-extended #64
  • Define POST user/resend_email (no login required) sending new token. Body: {"email": }
  • Update email template

Current email verification template:

image

Type of Change:

  • Code
  • Documentation

Code/Quality Assurance Only

  • This change requires a documentation update (software upgrade on readme file)
  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

  • Add 3 tests for the token confirmation function on UserDAO
  • I created a test email because I need credentials to send emails on behalf of some entity (exported sensitive data into environment variables as explained on README)
  • I’m registering users using temporary emails through https://temp-mail.org, to quickly test receiving verification emails (also I cannot use multiple users with the same email)

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged
  • Update Swagger documentation and the exported file at /docs folder

Code/Quality Assurance Only

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Dilu9218
Copy link
Contributor

Please resolve the conflicts :)

@isabelcosta
Copy link
Member Author

@Dilu9218 merge conflicts are solved!

@m-murad m-murad merged commit 795f0a7 into anitab-org:gsoc18-code Jul 2, 2018
@isabelcosta isabelcosta deleted the email-verification branch July 3, 2018 00:41
@isabelcosta isabelcosta added the Program: GSOC Related to work completed during the Google Summer of Code Program. label Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: GSOC Related to work completed during the Google Summer of Code Program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants