Token salt/hash management system for the server

Source:

Methods

(inner) clearTokens(db, userId) → {Promise}

Parameters:
Name Type Description
db function
userId string
Source:
Returns:
Type
Promise

(inner) createSaltAndSave(db, id, saltedHashes) → {Promise.<string>}

Parameters:
Name Type Description
db function
id string
saltedHashes Array.<string>
Source:
Returns:
Type
Promise.<string>

(inner) createToken(db, id) → {Q.Promise.<Array.<string>>}

Parameters:
Name Type Description
db function
id string
Source:
Returns:
Type
Q.Promise.<Array.<string>>

(inner) createToken_() → {Q.Promise.<string>}

Source:
Returns:
Type
Q.Promise.<string>

(inner) findByToken(db, token) → {Promise.<Array.<string>>}

Parameters:
Name Type Description
db function
token string
Source:
Returns:
Type
Promise.<Array.<string>>

(inner) invalidateToken(db, token) → {Promise.<T>|Request|*}

Parameters:
Name Type Description
db function
token string
Source:
Returns:
Type
Promise.<T> | Request | *

(inner) saveUserTokens(db, id, saltedHashes) → {Promise}

Parameters:
Name Type Description
db function
id string
saltedHashes Array.<string>
Source:
Returns:
Type
Promise

(inner) userFromToken(token) → {string}

Parameters:
Name Type Description
token string
Source:
Returns:
Type
string

(inner) verify(db, id, token) → {Promise.<{index: number, saltedHashes: Array.<string>}>}

Parameters:
Name Type Description
db function
id string
token string
Source:
Returns:
Type
Promise.<{index: number, saltedHashes: Array.<string>}>

(inner) verifyByToken(db, token) → {Promise.<{found: number, saltedHashes: Array.<string>}>}

Parameters:
Name Type Description
db function
token string
Source:
Returns:
Type
Promise.<{found: number, saltedHashes: Array.<string>}>