Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
VueJwtAuth
✓ import VueJwtAuth from 'vue-jwt-auth'
✗ import { VueJwtAuth } from 'vue-jwt-auth'
Default export; named import does not work.
Vue.use(VueJwtAuth, options)
✓ Vue.use(VueJwtAuth, options)
✗ new VueJwtAuth(options)
Must be used as a plugin via Vue.use().
this.$auth
✓ this.$auth.login(credentials)
✗ this.$auth.login(credentials).catch(...)
$auth is injected globally; login returns a promise.
Sets up vue-jwt-auth with default routes and redirects. This package is deprecated; prefer @websanova/vue-auth instead.
import Vue from 'vue';
import VueJwtAuth from 'vue-jwt-auth';
Vue.use(VueJwtAuth, {
register: '/api/register',
login: '/api/login',
logout: '/api/logout',
auth: '/api/user',
token: '/api/token',
refresh: '/api/refresh',
token_type: 'Bearer',
token_name: 'access_token',
refresh_token_name: 'refresh_token',
auth_redirect: '/login',
login_redirect: '/dashboard',
register_redirect: '/dashboard',
logout_redirect: '/login',
forbidden_redirect: '/401',
not_found_redirect: '/404',
forbidden_page: '/401',
not_found_page: '/404'
});
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app');
Errors
Common errors & fixes
Cannot find module 'vue-jwt-auth'
Package renamed or not installed.
fixUse npm install @websanova/vue-auth instead.
TypeError: VueJwtAuth is not a constructor
Using new VueJwtAuth() instead of Vue.use().
fixUse Vue.use(VueJwtAuth, options).
Upgrade
Version history
0.12.4-movedlatest on npm
Audit
Dependencies
No dependency data recorded yet.