Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auth-js

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-js

Auth JS Client for e-city

  • 0.0.16
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
10
Maintainers
4
Weekly downloads
 
Created
Source

auth-js

Auth JS Client for e-city

Installation

Using yarn

yarn add auth-js

Using npm

npm i --save auth-js

Usage

Config

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.

Sign In


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

Sign out current session of user.


this.$auth.signOut().then( response => {
  console.log('success', response)
})
.catch( e => {
  console.log('error', e)
})

Update passowrd

Update current passowrd of user.


this.$auth.updatePassword().then( response => {
  console.log('success', response)
})
.catch( e => {
  console.log('error', e)
})

Account

Update account of user.


this.$auth.account().then( response => {
  console.log('success', response)
})
.catch( e => {
  console.log('error', e)
})

Image

Change image of perfil the user.


this.$auth.image().then( response => {
  console.log('success', response)
})
.catch( e => {
  console.log('error', e)
})

Address

Update address of user.


this.$auth.address().then( response => {
  console.log('success', response)
})
.catch( e => {
  console.log('error', e)
})

Modules

Insert/Remove modules of user.


this.$auth.modules().then( response => {
  console.log('success', response)
})
.catch( e => {
  console.log('error', e)
})

Current

Get current user.


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

Keywords

FAQs

Package last updated on 24 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc