Namespace: auth

$volt.auth

Volt Auth Library

Provides functions for built-in authentication API.

Source:

Methods

(static) confirm(token, callbackopt)

Confirm an account

Parameters:
Name Type Attributes Description
token string

the confirmation token

callback voltCallback <optional>

no data is returned on success - if not passed, a promise is returned

Source:

(static) forgot(email, appIdopt, callbackopt)

Request a forgotten password email to be send

Parameters:
Name Type Attributes Description
email string

the email to be logged in

appId string <optional>

defaults to the appId passed on init

callback voltCallback <optional>

no data is returned on success - if not passed, a promise is returned

Source:

(static) isLoggedIn() → {boolean}

Returns true if a user appears to be logged in

This function does not touch the API - it just checks for certain properties on the volt state object. The user may not actually have a valid session.

Source:
Returns:
Type
boolean

(static) login(email, password, appIdopt, callbackopt)

Authenticate a user

The login is managed by the API automatically, there is no need to manage the state yourself.

Parameters:
Name Type Attributes Description
email string

the email to be logged in

password string

the password of the user

appId string <optional>

defaults to the appId passed on init

callback voltCallback <optional>

upon success the data param will contain an OAuth2 access token response - if not passed, a promise is returned

Source:

(static) logout()

Log out the currently authenticated user

This simply removes authentication token and associated details from volt's current state object.

Source:

(static) register(email, password, confirmation, appIdopt, callbackopt)

Register a new user

Parameters:
Name Type Attributes Description
email string

the email to be registered

password string

the password of the user

confirmation string

the password confirmation

appId string <optional>

defaults to the appId passed on init

callback voltCallback <optional>

upon success the data param will contain an API user object (see the response section of the API spec) - if not passed, a promise is returned

Source:

(static) resend(email, appIdopt, callbackopt)

Request a confirmation email to be resent

Parameters:
Name Type Attributes Description
email string

the email to be logged in

appId string <optional>

defaults to the appId passed on init

callback voltCallback <optional>

no data is returned on success - if not passed, a promise is returned

Source:

(static) reset(token, password, confirmation, callbackopt)

Reset a password

Parameters:
Name Type Attributes Description
token string

the reset token

password string

the password with which to update the account

confirmation string

the password confirmation

callback voltCallback <optional>

no data is returned on success - if not passed, a promise is returned

Source: