Skip to content

pubcore/express-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express authentication middleware

Implementation for @pubcore/authentication

Prerequisites

  • Node.js
  • Express webserver
  • Knex

Example

const login = require('@pubcore/express-login'),
	app = express(),
	options = {
		methods: {jwt:{}, form:{}, basicAuth:{}},
		publicDeactivatedUri: '/login/deactivated',
		publicCancelLoginUri: '/login/canceled',
		changePasswordUri:'/login/pwchange',
		maxTimeWithoutActivity: 1000 * 60 * 60 * 24 * 180, //[msec]
		maxTimeWithout401: 1000 * 3600, //[msec]
		maxLoginAttempts: 2,
		maxLoginAttemptsTimeWindow: 1000 * 3600 * 12, //[msec]
		minTimeBetweenUpdates: 1000 * 60, //[msec]
		jwtKeyFile: '/path/to/keyfile'
	},
	db = {knex, table:'users'}

app.use(login({db, options}))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published