-
Notifications
You must be signed in to change notification settings - Fork 6
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
#167730738 Build signup feature with token as response #30
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Start #167730738]
…er service [Fix #167730738]
[Complete #167730738]
…route [Fix #167730738]
[Fix #167730738]
[Fix #167730738]
[Fix #167730738]
[Fix #167730738]
[Fix #167730738]
[Fix #167730738]
…132443-create-role.js
[Fix #167730738]
…firestar-backend into ft-signup-user-167730738
[Fix #167730738]
[Fix #167730738]
[Fix #167730738]
[Fix #167730738]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
It Builds signup feature and provide token as response and also send email to newly signed up user for account verification. When User verifies his/her email the user table field (
isVerified
) is updated to trueDescription of Task to be completed?
N/A
How should this be manually tested?
Please Note: This is a follow up ticket to the ticket ft-email-verification-167730740
git clone -b ft-signup-user-167730738 https://github.com/andela/firestar-backend.git .
npm install
and create a.env file
and provide the following information to itPlease kindly make a reference to the file
env.example
for their description and the slack channel for this project for anyenv
variable valuebarefoot and barefoot_test
)Run
npm run migrate:dev
to create a user table. ** Note At any point in time you can drop this table by runingsequelize db:migrate:undo:all
and runnpm run seed:dev
to seed some datas. The purpose for this is to make sure our roles table is filled with sample datastart the server with
npm run start:dev
Now use postman and go to
localhost:PORT/api/v1/users/auth/register
using aPOST
request with a body ofAlso feel free to use invalid details to see the different response on each error
isVerified
isfalse
Observe as well that the the user table contain a field
isVerified
which checks if user is verified.Visit the email you provided and see the newly delivered email which contains your name and link to verify your account. Make sure your server is still ruining. Click on this email or copy full URL address
![Screenshot (60)](https://user-images.githubusercontent.com/38135488/64216192-a5eecc80-ceaf-11e9-9e00-33b15d3bfd26.png)
make a
get
request with the copied link that looks like thishttp://localhost:PORT/api/v1/users/email/verify?id=token
to verify your accountUse any GUI database tool to see your User table
isVerified
updated fromfalse
totrue
which indicates that your account has been verified. Also you can see the newly inserted data from logins tableYou can also decide to access other protected routes. to do this copy the token gotten during signup and use it in postman header as
Authorization
. An example of a protected route ishttp://localhost:PORT/api/v1/users/myaccount
You can test it as wellauthorization
andjwtVerify
as shown on the screenshotAny background context you want to provide?
Please note that two token are used, In this feature.
token that is used as query string on verification link which also expires in 24hrs
User token upon signup which would be used as Authorization in header to access other protected route
What are the relevant pivotal tracker stories?
#167730738
Screenshots or gifs (if appropriate)
Test coverage information
Questions:
Great job @zanio
correct
EMAIL_VERIFY_TOKEN_SECRET_KEY
toSECRET_KEY_EMAIL_VERIFY_TOKEN
infirestar-backend/src/utils/index.js