Skip to content

Nodejs authentication with email, google and facebook providers.

Notifications You must be signed in to change notification settings

funwiche/nodejs-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodejs Auth

Send emails from your Nuxtjs App using Nodemailer. Rich user interface to send emails and attachments.

Setup

Make sure to install the dependencies:

# yarn
yarn install

# npm
npm install

Create a .env file and add the following variables:

DB_URL= #MongoDB
ACCESS_TOKEN_SECRET= #JsonWebToken Secret
GOOGLE_CLIENT_ID= #Google Client ID
GOOGLE_CLIENT_SECRET= #Google CLient Secret
FACEBOOK_CLIENT_ID=  #Facebook Client ID
FACEBOOK_CLIENT_SECRET=  #Facebook CLient Secret

Development Server

Start the development server on http://localhost:3001

# yarn
yarn dev

# npm
npm run dev

Routes

Authentication

POST   /auth/register
POST   /auth/login
POST   /auth/forgot
PATCH  /auth/reset

Oauth2

GET    /oauth2/google
GET    /oauth2/google/redirect
GET    /oauth2/facebook
GET    /oauth2/facebook/redirect

Users

Note: All routes takes auth middleware to verify user using token sent in request header

GET    /users
PATCH  /users/password
PATCH  /users/name
PATCH  /users/email
DELETE /users

Releases

No releases published

Packages

No packages published