Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Password less Authentication Service APIs

Written in nodeJs, MongoDB and use SendGrid API as email service.

Installation

Clone the repository:

git clone https://github.com/ujjwall-R/Passwordless-authentication-APIs
cd Passwordless-authentication-APIs

Install the dependencies:

npm i

Usage

Get your sendgrid API from https://sendgrid.com. Setup the MONGODB ATLAS.

Create a .env file with following template:

.env

SENDGRID_API_KEY=""
MONGODB_URL=""
SENDEREMAIL=""

Deploy the node app on any cloud service.

APIs

Register

POST /users/signup
#Request body
{
    "name": "John Doe",
    "email": "johnxxxxxxxxx@gmail.com",
    "gender":"male"
}

#Response
{
    "name": "John Doe",
    "email": "johnxxxxxxxxx@gmail.com"
}

Login

POST /users/login
#Request body
{
    "email":"johnxxxxxxxxx@gmail.com"
}

#Response
{
    "user": {
        "_id": "641ff966253xxxxxxxx",
        "name": "John Doe",
        "email": "johnxxxxxxxxx@gmail.com",
        "gender": "male",
        "__v": 1
    }
}

Verify OTP

POST /users/verify
#Request body
{
    "email":"johnxxxxxxxxx@gmail.com",
    "otp":"xxxx"
}
#Response
{
    "user": {
        "_id": "641ff966253xxxxxxxx",
        "name": "John Doe",
        "email": "johnxxxxxxxxx@gmail.com",
        "gender": "male",
        "__v": 1
    },
    "token": "eyJhbGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Password less authentication APIs written in Nodejs, javascript and MongoDB.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages