Nodejs API for Authentication
* Express.js
* Handlebars
* MySQL
* JWT (Json Web Token)
- Clone this repository
git clone https://github.com/dollpriyanka/Node_Authentication_API
- Go to the cloned directory
- Initialize the directory
npm init -y
- Install dependencies
npm install
POST/login:
To login a user we need to send email and password of the user in http body
POST/sign-up:
To signup a user we need to send name, email, password of the user in http body
POST/forgot_password:
If a user forgot their password we need to send email and get a token in the http body
PATCH/reset_password:
Using forgot_password email we need to generate new password using http body
1.Sign-up:
Http body: {
"name":"Jack Melson",
"email": "test@gmail.com",
"password":"test123$",
"confirm password":"test123$"
}
Response: {
"token": "yjgsjjsgysy789fehfhklijlejlejrljlwjkwjkjwrkljrlrjfks,s,gggn,k"
}
2.Login:
Http body: {
"email": "test@gmail.com",
"password":"test123$"
}
Response: {
"token": "yjgsjjsgysy789fehfhklijlejlejrljlwjkwjkjwrkljrlrjfks,s,gggn,k"
}
3.Forgot_Password:
Http body: {
"email": "test@gmail.com"
}
Response: {
"token": "yjgsjjsgysy789fehfhklijlejlejrljlwjkwjkjwrkljrlrjfks,s,gggn,k"
}
4.Reset_Password:
Http body: {
"password":"test123$"
}
Response: {
"token": "yjgsjjsgysy789fehfhklijlejlejrljlwjkwjkjwrkljrlrjfks,s,gggn,k"
}