Auth-module: Can not make Auth module works with refresh token - the module losts strategy

Created on 24 Mar 2020  Â·  6Comments  Â·  Source: nuxt-community/auth-module

Version

v4.9.0

Reproduction link

https://github.com/axel-verse/nuxt-auth-bug

Steps to reproduce

1) Setup Auth module as it described in https://github.com/nuxt-community/auth-module/pull/361
2) Try to use $auth.loginWith at any page

What is expected ?

Successfull login

What is actually happening?

TypeError: Cannot read property 'mounted' of undefined
at Auth.mounted (auth.js?facc:112)
at Auth.setStrategy (auth.js?facc:108)
at Auth.loginWith (auth.js?facc:123)
at VueComponent.doLogin (index.vue?6ced:21)
at click (index.vue?d50a:53)
at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
at HTMLButtonElement.invoker (vue.runtime.esm.js?2b0e:2179)
at HTMLButtonElement.original._wrapper (vue.runtime.esm.js?2b0e:6917)

Additional comments?

Any help is appreciated

This bug report is available on Nuxt community (#c523)

All 6 comments

Had the same problem, I think the npm version goes off the master branch, while the dev branch has the refresh support added... I fixed it by changing "@nuxtjs/auth": "^4.9.0", to "@nuxtjs/auth": "nuxt-community/auth-module#dev", in package.json... at least until the dev is synced with master.

@martijnd, thanks you for you help, your solution works for me.

So for now all that left is wait for sync

The issue was solved at GitHub

@martijnd

@nuxtjs/auth": "nuxt-community/auth-module#dev",

when changing my package.json to this, delete @nuxtjs-auth from node_modules and run yarn install no nuxt auth module is installed, running nuxt fails with a module not found for nuxt auth

Hi @chris-aeviator! That answer is outdated.
We published the dev branch as @nuxtjs/auth-next. Just run yarn add @nuxtjs/auth-next :)

Ok – I was unsure if both were the same thing thanks for clarification

Was this page helpful?
0 / 5 - 0 ratings