Skip to content

Commit

Permalink
fix: warn only needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Sep 6, 2017
1 parent 78dca93 commit a9dbe04
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions templates/auth.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import authStore from './auth.store'
export default async function (ctx, inject) {
const { store } = ctx

// Check axios module is correctly registered
if (!ctx.$axios) {
/* eslint-disable no-console */
console.error('[@nuxtjs/auth]', 'Please make sure @nuxtjs/axios is added after this module!')
}

// Inject $ctx
inject('ctx', ctx)

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

0 comments on commit a9dbe04

Please sign in to comment.