@websanova/vue-auth
Version:
A simple light-weight authentication library for Vue.js
7 lines (6 loc) • 799 B
JavaScript
/*!
* @websanova/vue-auth v4.2.1
* https://websanova.com/docs/vue-auth
* Released under the MIT License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.VueAuth=t()}(this,function(){"use strict";return{init:function(){if(!this.plugins.router)return"drivers/router/vue-router.2.x.js: router plugin has not been set."},beforeEach:function(n,u,o,i){var c=this;this.plugins.router.beforeEach(function(t,e,r){o(t),n.call(c,function(){var e=i(t);u.call(c,t,e,function(e){e?r?r(e):this.router._routerReplace.call(this,e):(r||t.next)()})})})},routerReplace:function(e){this.plugins.router.replace.call(router,e)},routerGo:function(e){var t=this.plugins.router;(t.push||t.go).call(t,e).catch(function(e){})}}});