qAuth
This module globally injects $qAuth instance, meaning that you can access it anywhere using this.$qAuth. For plugins, asyncData, fetch, nuxtServerInit and Middleware, you can access it from context.$qAuth.
properties
All properties are reactive. Meaning that you can safely use them in Vue template v-if conditions.
user
This object contains details about authenticated user such as name. You can access it using either $qAuth or Vuex.
// Access using $qAuth
this.$qAuth.user
// Access using vuex
this.$store.state.qAuth.user
loggedIn
This boolean flag indicates that user is authenticated and available at the moment or not.
// Access using $qAuth
this.$qAuth.loggedIn
// Access using vuex
this.$store.getters['qAuth/loggedIn']
busy
// Access using $qAuth
this.$qAuth.busy
// Access using vuex
this.$store.getters['qAuth/busy']
methods
login(loginMutationVariables)
- Returns : 
Promise 
   this.$qAuth.login({...loginMutationVariables})
     .then((result) => {
       if(result.success){
         this.$toast.success('Logged In!')
       }
     })
this.$qAuth.login<TMutation,TVariables,TQuery,TUser>(loginMutationVariables)
  .then((result) => { 
    if(result.success){
      this.$toast.success('Logged In!')
    }
  })
login result containing {success, token, mutationResponse, user, queryResponse} :
success:
type :boolean
returnstrueif login successful.token:
type:string|null
returnstokenifloginMutationrequest successful.mutationResponse:
type:FetchResult<TMutation, Record<string, any>, Record<string, any>>|null
returnsloginMutationresponse if request successful.user:
type:object|null
returnsuserobject ifuserQueryrequest successful.queryResponse:
type:FetchResult<TQuery, Record<string, any>, Record<string, any>>|null
returnsuserQueryresponse if request successful.
logout()
- Returns : 
Promise 
this.$qAuth.logout()
  .then(() => {
      this.$toast.success('Logged Out!')
  })
hasScope(scopeName)
Check if user has a specific scope:
// Returns is a computed boolean
this.$qAuth.hasScope('admin')