User

A model for Users

removeToken

Removes a token

Parameters

token
String

clearSensitiveData

Clears all sensitive data

Parameters

setScopes

Sets all project scopes

Parameters

project
String
scopes
Array

generateToken

Creates a new access token

Parameters

persist
Boolean

validateToken

Validate token

Parameters

token
String

Returns

Boolean
valid

cleanUpTokens

Cleans up expired tokens

Parameters

validatePassword

Validate password

Parameters

password
String

Returns

Boolean
valid

setPassword

Set new password

Parameters

password
String

createPasswordHashSalt

Creates a password hash and salt

Parameters

password
String

Returns

Object
Hash and salt

sha512

Creates a sha512 hash

Parameters

string
String
salt
String

Returns

String
hash

create

Creates a new user object

Parameters

username
String
password
String

Returns

User
user