Plugin for request authentication from Sellsuki login.
- vue
- vue-router
Initiate plugin by Vue.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})
Plugin will validate authentication from cookies in local
router.beforeEach((to, from, next) => {
Vue.prototype.$sellsuki_auth.authChecker(next)
})