0

I am using nuxt js + @nuxjs/auth (4.9.1) to build a project.

The problem is when I use this.$auth.strategy.token.get() to access authorization token the error Cannot read property 'get' of undefined occur.

How can I access authorization token in @nuxtjs/auth?

farhad.a
  • 341
  • 4
  • 17

1 Answers1

0

I'm using a custom strategy defined in nuxt.conf.js as follows :

  auth: {
    strategies: {
      customStrategy: {
        scheme: '~/schemes/customScheme',
        ....

and I can get the token using the following path :

  console.log(this.$auth.$storage._state['_token.customStrategy'])
Boussadjra Brahim
  • 82,684
  • 19
  • 144
  • 164