Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 1.38 KB

auth.md

File metadata and controls

77 lines (53 loc) · 1.38 KB

Auth

Overview

The resources responsible for user auth

Available Resources

  1. netField.generateUserToken(params, [callback])

  2. netField.verifyUserToken([callback])

  3. netField.revokeUserToken([callback])

  4. netField.auth.resetPassword(email, [callback])

  5. netField.auth.setPassword(params, [callback])

Resource Usage

generateUserToken

Calls the API to get a user token which is then saved in the config
/**
 * @param {object} params
 * @param {function} callback optional
*/
netField.generateUserToken(params, [callback])

verifyUserToken

Verify token if it's valid
/**
* @param {function} callback optional
*/
netField.verifyUserToken([callback])

revokeUserToken

Revoke token (logout)
/**
 * @param {function} callback optional
*/
netField.revokeUserToken([callback])

resetPassword

Send email with password reset token
/**
 * @param {string} email
 * @param {function} callback optional
*/
netField.auth.resetPassword(email, [callback])

reset

Set new user password
/**
 * @param {object} params
 * @param {function} callback optional
*/
netField.auth.setPassword(params, [callback])