@elmsti-systems/mercy-auth
Authorization and authentication module.
Last updated 2 years ago by carljoel_elmsti .
UNLICENSED · Original npm · Tarball · package.json
$ cnpm install @elmsti-systems/mercy-auth 
SYNC missed versions from official npm registry.

Vigil

Authorization and authentication module.

Basic usage

import {configureAuth} from '@elmsti-systems/mercy-auth'
import {Server} from 'hapi'

import {routes} from './routes'
import {sequelize, User} from '../models'

export async function createServer() {
  const server = new Server()

  server.connection({
    port: 8000,
    routes: {
      cors: true
    }
  })

  await configureAuth({
    jwtSecret,
    server,
    sequelize,
    mail: {
      transporter: {
        sendMail(mail) {
          console.log('MAIL', mail)
        }
      },
      from: '"Company" <no-reply@domain.se>',
    },
    user: {
      model: User,
      clientProps: ['id', 'name', 'email',],
    },
  })

  server.route(routes)

  return server
}

Current Tags

  • 0.1.22                                ...           latest (2 years ago)

1 Versions

  • 0.1.22                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 3
Dependencies (21)
Dev Dependencies (29)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |