Auth JS Client for e-city
npm install auth-jsauth-js
=======
> Auth JS Client for e-city
Installation
------------
yarn add auth-js
npm i --save auth-js
Usage
=====
Config
------
``javascript`
const baseURL = 'http://isse.paliari.com.br/app/rest'
const Auth = {
install (Vue, {baseURL}) {
const auth = AuthJs({appModule: 'nfse', baseURL, statusBar: 'darken'})
Vue.prototype.$auth = auth
Vue.auth = auth
}
}
Vue.use(Auth, {baseURL})
Methods
-------
All methods return the Promise instance.
`javascript
this.$auth.signIn().then( response => {
// the response contains token and usuario e.g: {token: {...}, usuario: {...}}
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
`
Sign out current session of user.
`javascript
this.$auth.signOut().then( response => {
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
`
Update current passowrd of user.
`javascript
this.$auth.updatePassword().then( response => {
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
`
Update account of user.
`javascript
this.$auth.account().then( response => {
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
`
Change image of perfil the user.
`javascript
this.$auth.image().then( response => {
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
`
Update address of user.
`javascript
this.$auth.address().then( response => {
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
`
Insert/Remove modules of user.
`javascript
this.$auth.modules().then( response => {
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
`
Get current user.
`javascript
this.$auth.current().then( response => {
console.log('success', response)
})
.catch( e => {
console.log('error', e)
})
``
Dependencies
============
- Promise (the browser suporte reuquired), see: MDN Promise
License
-------
This project is licensed under MIT License