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

[#164046247] Users can verify their accounts #23

Merged
merged 1 commit into from
Mar 14, 2019

Conversation

MandelaK
Copy link
Contributor

@MandelaK MandelaK commented Mar 13, 2019

Description

Whenever users create an account, it is good practice to have them verify their email addresses so we can be sure that the users are indeed real and that they own the accounts they used for registration. This feature implements email verification by sending a JWT token to the user email address that should be decoded. If the token is valid, the token is decoded and the user is redirected to a callback URL that they provided when registering.

Type of change

  • Breaking Change(Users must provide a callback url when registering, Unverified users cannot log in )
  • Non-breaking changes ( Users can get a new verification token if the old one expires, Users can verify their accounts via email)

How Has This Been Tested?

  • Unit Tests
  • Integration Tests

Checklist:

  • I have tested all new functions
  • Feature passes team flake8 standards
  • Refactored prior tests to make them pass considering I have breaking changes

How can this be manually tested?

  • Follow instructions on the README page and set up your environment locally.
  • Check out to this branch ft-email-verification-164046247 and install requirements by running pip install -r requirements.txt
  • Register a user using a valid email address, and be sure to add a callback URL. It can be any URL of your choice. Here is an example:
{"user": {
"username": "cray",
"email": "cray@mail.com",
"password": "password",
"callback_url": "http://www.youtube.com"}}
  • You should get a response that you check your email address for a verification link. Copy and paste that link in your browser and you should be redirected to the callback url you provided. Verified users should not be able to verify again, and users should only be able to verify their own email addresses.
  • To get a new verification token, navigate to the endpoint /api/token/ and pass in your username and email. If you pass in incorrect information, you should not be able to get a reset token. Only registered users can get a reset token. To verifiy the token, simply go to your email address and copy and paste the link in your browser. You should be redirected to the callback URL you provided

PT

#164046247

@MandelaK MandelaK changed the title feat(email verification): Users can verify their accounts [#164046247] Users can verify their accounts Mar 13, 2019
@MandelaK MandelaK force-pushed the ft-email-verification-164046247 branch 3 times, most recently from 969bece to 08c9715 Compare March 14, 2019 08:58
@MandelaK MandelaK force-pushed the ft-email-verification-164046247 branch from 08c9715 to 7527899 Compare March 14, 2019 09:35
@abulojoshua1
Copy link
Contributor

abulojoshua1 commented Mar 14, 2019

@MandelaK, kindly fix the failing build.

@MandelaK
Copy link
Contributor Author

@MandelaK, kindly fix the failing build.

Okay, Let me get the access tokens and rerun the builds

- Users can verify their accounts via email
- Unverified users cannot log in
- Emails can now be sent via the sendgrid smtp server
- Users can request new verification links
- Users must send callback url when registering accounts

[starts #164046247]
@MandelaK
Copy link
Contributor Author

@abulojoshua1 the build is passing now, the coverage is also back to 99%

Copy link
Contributor

@BrianSerem BrianSerem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a struggle with the builds, you finally came out the winner.

@abulojoshua1 abulojoshua1 merged commit f42b1fc into develop Mar 14, 2019
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.

None yet

6 participants