@gluedigital/auth

0.2.6 • 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.

Readme

Keywords

Package Sidebar

Install

npm i @gluedigital/auth

Weekly Downloads

1

Version

0.2.6

License

MIT

Unpacked Size

157 kB

Total Files

13

Last publish

Collaborators

  • linuxgunter
  • landesag
  • csar
  • mancontr
  • alex_bf
  • javibt