0.0.3 • Published 7 years ago

vue-sellsuki-auth v0.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Sellsuki Auth

Plugin for request authentication from Sellsuki login.

Requirement

  • vue
  • vue-router

Initiate

Initiate plugin by js.use after VueRouter with target url and router

import Vue from 'vue'
import VueRouter from 'vue-router'
import SellsukiAuth from 'vue-sellsuki-auth'

...

var router = new VueRouter({
  routes: [
    { path: '/hello', component: Hello },
    { path: '*', redirect: Home }
  ]
})

Vue.use(SellsukiAuth, {target: 'loginURL', router: router})

AuthChecker

Plugin will validate authentication from cookies in local

router.beforeEach((to, from, next) => {
  Vue.prototype.$sellsuki_auth.authChecker(next)
})