Skip to content

Sellsuki/vue-sellsuki-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sellsuki Auth

Plugin for request authentication from Sellsuki login.

Requirement

  • vue
  • vue-router

Initiate

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})

AuthChecker

Plugin will validate authentication from cookies in local

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

Releases

No releases published

Packages

No packages published