Skip to content

Commit a9dbe04

Browse files
author
Pooya Parsa
committed
fix: warn only needed
1 parent 78dca93 commit a9dbe04

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

templates/auth.plugin.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import authStore from './auth.store'
44
export default async function (ctx, inject) {
55
const { store } = ctx
66

7-
// Check axios module is correctly registered
8-
if (!ctx.$axios) {
9-
/* eslint-disable no-console */
10-
console.error('[@nuxtjs/auth]', 'Please make sure @nuxtjs/axios is added after this module!')
11-
}
12-
137
// Inject $ctx
148
inject('ctx', ctx)
159

@@ -21,5 +15,10 @@ export default async function (ctx, inject) {
2115
await store.dispatch('auth/fetch')
2216
} catch (e) {
2317
// Not authorized
18+
// Check axios module is correctly registered
19+
if (!ctx.$axios) {
20+
/* eslint-disable no-console */
21+
console.error('[@nuxtjs/auth]', 'Please make sure @nuxtjs/axios is added after this module!')
22+
}
2423
}
2524
}

0 commit comments

Comments
 (0)