Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@gluedigital/auth

0.1.0 • Public • Published

Glue Auth

Module that allows to manage all the authentication of an application including the sending of emails

Usage

router.use(['/auth/*'], endpoints.routes(), endpoints.allowedMethods())
router.use('/api/*', authorize)
router.get('/api/demo', (ctx, next) => { ctx.body = 'Hello, visitor!' })
router.get('/api/user/getMe', requireLoggedIn, (ctx, next) => { ctx.body = 'Hello, user ' + ctx.user.id })
router.get('/api/admin/demo', requireRole('ADMIN'), (ctx, next) => { ctx.body = 'Hello, admin ' + ctx.user.id })

Developing

To try your changes in @gluedigital/auth, clone this repo and use yarn link, then link it in the demo project with yarn link @gluedigital/auth. We also provide a "watch mode" to rebuild the bundle on change, which you can start with yarn watch.

Keywords

Install

npm i @gluedigital/[email protected]

Version

0.1.0

License

MIT

Unpacked Size

129 kB

Total Files

13

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar