Skip to content

remap-app/authenticate-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

authenticate-middleware

CircleCI

yarn add @remap/authenticate-middleware

Usage

const compose = require('micro-compose')
const { handleErrors } = require('micro-errors')
const authenticateMiddleware = require('@remap/authenticate-middleware')

module.exports = compose(
  handleErrors(),
  authenticateMiddleware(),
)(
  async (req, res) => {
    // req.auth
    // {
    //   name: string;
    //   picture: string;
    //   auth_time: number;
    //   email: string;
    //   email_verified: boolean;
    //   uid: string;
    // }
  }
)

Optional custom authenticator

const middleware = authenticateMiddleware({
  authenticate: async () => await doSomething(),
})

About

ReMap Authenticate Middleware

Resources

Stars

Watchers

Forks

Packages

No packages published