import EmailAuth from 'node-user-accounts-boilerplate/node-user-accounts-boilerplate-nahid/auth/EmailAuth.js'
Constructor Summary
Public Constructor | ||
public |
constructor(options: object) |
Member Summary
Public Members | ||
public |
If true, it remembers any passwords specified registration. |
|
public |
Name of application. |
|
public |
block: * Settings for rate limiting failed requests. |
|
public |
Instance of crypt class for encrypting and verifying passwords. |
|
public |
Instance of email sender class for sending emails. |
|
public |
Email from address Used for sending email. |
|
public |
recaptcha: * Settings for rate limiting through recaptcha. |
Method Summary
Public Methods | ||
public |
async createProfileFromCredential(id: *, extra: {}): * helper method that creates a profile object from a credential address |
|
public |
createUserFromProfile(profile: *): * Override of helper method that inserts password into produced user if allowed by setting. |
|
public |
install(app: *, prefix: *, passport: *) |
|
public |
async passwordlessImpl(req: *, res: *): * sends temporary login password to email address |
|
public |
sendTemporaryPassword(theme: string, to: string, password: string, expireMinutes: number, loginLinkPrefix: string): * Helper method that sends temporary password to an email address for rego/login. |
|
public |
async strategyImpl(req: *, username: *, password: *, done: *) logs users in based on token or based on username(email)/password |
Inherited Summary
From class Auth | ||
public |
Additional settings given to passport.authenticate. |
|
public |
Custom fields |
|
public |
Default error message to return instead of actual errors (security). |
|
public |
Default roles new registered users should assume. |
|
public |
description: * This is a standard descriptor of this authentication mechanism that is publicly shared. |
|
public |
method: * Authentication method name. |
|
public |
users: CachedCollection Users collection. |
|
public |
async createProfileFromCredential(id: *, extra: {}): * helper method that creates a profile object from a credential address |
|
public |
createUserFromProfile(profile: Profile): User Helper method that creates an User object from a Profile |
|
public |
Helper method that finds an user based on a credential. |
|
public |
generateId(): * |
|
public |
handleUserLoginByProfile(username: string, profile: Profile, done: Function, req: Request) Helper method for SSO type logins. |
|
public abstract |
Must be overridden to provide implementation of said authentication method. |
|
public |
Helper method that produces a middleware to handle successful logged in case. |
Public Constructors
public constructor(options: object) source
Override:
Auth#constructorParams:
Name | Type | Attribute | Description |
options | object | see Auth class + additional options for email configuration. |
Public Members
public allowPasswordSettingDuringRegistration: * source
If true, it remembers any passwords specified registration.
public emailSender: EmailSender source
Instance of email sender class for sending emails.
If this is not specified, email login is disabled.
public recaptcha: * source
Settings for rate limiting through recaptcha.
Note: use this or recaptcha.
Public Methods
public async createProfileFromCredential(id: *, extra: {}): * source
helper method that creates a profile object from a credential address
Override:
Auth#createProfileFromCredentialParams:
Name | Type | Attribute | Description |
id | * | ||
extra | {} |
|
Return:
* |
public createUserFromProfile(profile: *): * source
Override of helper method that inserts password into produced user if allowed by setting.
Override:
Auth#createUserFromProfileParams:
Name | Type | Attribute | Description |
profile | * |
Return:
* |
public install(app: *, prefix: *, passport: *) source
Must be overridden to provide implementation of said authentication method.
Override:
Auth#installParams:
Name | Type | Attribute | Description |
app | * | ||
prefix | * | ||
passport | * |
public async passwordlessImpl(req: *, res: *): * source
sends temporary login password to email address
Params:
Name | Type | Attribute | Description |
req | * | ||
res | * |
Return:
* |
public sendTemporaryPassword(theme: string, to: string, password: string, expireMinutes: number, loginLinkPrefix: string): * source
Helper method that sends temporary password to an email address for rego/login.
Should be able to override this to specify custom formats for email.
Params:
Name | Type | Attribute | Description |
theme | string | register | recover | passwordless etc. anything other than login or verify |
|
to | string | target email address |
|
password | string | temporary login token |
|
expireMinutes | number | number of minutes after which this login token will expire |
|
loginLinkPrefix | string |
|
forward url for any links in email |
Return:
* |
public async strategyImpl(req: *, username: *, password: *, done: *) source
logs users in based on token or based on username(email)/password
Params:
Name | Type | Attribute | Description |
req | * | ||
username | * | ||
password | * | ||
done | * |