0.1.4 • Published 8 years ago
touress-fe-core v0.1.4
Touress Core - Frontend
Core logic for frontend side should be all here (www, admin and mobile app)
Installation
$ npm install --save touress-fe-coreUsage
// import the module
let core = requrire('touress-fe-core');
// for authentication use 'auth' object
let errors = core.auth.validateCredentials('your-username', 'your-password');
if(errors.size() > 0){
// handle errors
}
// success, do something elseAPI
Authentication -
auth.login(username, password)- A function to login usingusernameandpassword, mostly with end customers.- return : Promise for
successanderror.
- return : Promise for
.loginWithCompanyCode(username, password, companyCode)- A function to login usingusername,passwordandcompanyCode. It will be used by admin.- return : Promise for
successanderror.
- return : Promise for
.validateCredentials(username, password)- A function to validate whether or not theusernameandpasswordyou pass in are valid.- return :
errorsas string[], contain one or more error message.
- return :