LocalAuthModule

localauth. LocalAuthModule

Module which implements username/password (local) authentication

Constructor

new LocalAuthModule()

Source:

Extends

  • AbstractAuthModule

Members

users :UsersModule

Source:
Local reference to the current UsersModule instance for convenience
Type:
  • UsersModule

Methods

(static) formatRemainingTime(secs)

Source:
Returns a human-readable string to denote how many seconds are remaining
Parameters:
Name Type Description
secs Number The remaining seconds

(async) authenticate()

Source:

(async) changePasswordHandler(req, res, next)

Source:
Handles changing a user password. If no auth is given, a reset token must be present
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) createPasswordReset(email, subject, textContent, htmlContent, lifespan)

Source:
Creates a new password reset token and sends an email
Parameters:
Name Type Description
email String
subject String
textContent String
htmlContent String
lifespan Number The lifespan of the reset

(async) forgotPasswordHandler(req, res, next)

Source:
Handles sending a user password reset
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) handleLockStatus(req, user)

Source:
Checks if the user account is currently locked, and unlocks a temporarily locked account if appropriate
Parameters:
Name Type Description
req external:ExpressRequest
user Object The current user

(async) init()

Source:

(async) inviteHandler(req, res, next)

Source:
Handles inviting a new user to the system
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) register()

Source:

(async) registerSuperHandler(req, res, next)

Source:
Registers a Super User. This is restricted to localhost, and can only be used to create the first Super User.
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) setUserEnabled()

Source:

(async) setValues()

Source:

(async) updateUser(req, userIdOrQuery, updateData) → {Promise}

Source:
Updates a single user
Parameters:
Name Type Description
req external:ExpressRequest
userIdOrQuery String | ObjectId | Object Accepts a user _id or a query object
updateData Object JSON data to use for update
Returns:
Type
Promise

(async) validatePasswordHandler(req, res, next)

Source:
Handles changing a user password. If no auth is given, a reset token must be present
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function