userz

0.1.1 • Public • Published

Description

A small module for Express that takes care of redundant aspects of user-management. The module adds the required endpoints to your project, provides events, authentication-middleware and exposes its controller-functions for direct manipulation in your core project.

Features

  • Register Users
  • Verify Users
  • Change E-Mail Addresses
  • Handle forgotten Passwords
  • Authenticating Users
  • Disabling/Blacklist Users

Requirements (for now)

  • Express
  • MongoDB

Basic Usage

auth.js

const Userz = require('userz')
const app = require('../app')
const mongoose = require('mongoose')

// initiate
let userz = Userz({
  mongoose,
  secret: process.env.JWT_SECRET
  config: {
    authTokenExpiration:"1d",
    cookieName: "token",
    passwordValidation: password => password.length > 5,
    disableErrorHandling: false  
  }
})

app.use('/auth', userz.routes)

module.exports = userz // {middleware, events, controllers, routes}

Readme

Keywords

none

Package Sidebar

Install

npm i userz

Weekly Downloads

4

Version

0.1.1

License

ISC

Unpacked Size

251 kB

Total Files

49

Last publish

Collaborators

  • seltsam23