SohoHouse / nuxt-oauth

Simple OAuth2 integration for your Nuxt app
MIT License
122 stars 27 forks source link

v2.5 breaks when authenticating a page #54

Open evanrlong opened 4 years ago

evanrlong commented 4 years ago

I'm using nuxt-oauth to authenticate with Okta. When I upgrade to v2.5 of nuxt-oauth, my auth workflow breaks. When I try to hit a page protected by authentication, the page does not render and I see the following error in my logs.

Screen Shot 2020-06-09 at 8 24 02 PM

I can't share my work code, but I see the same problem with the nuxt okta tutorial project here. If you clone that project, pass in the appropriate environment variables to get it running with okta, upgrade the nuxt-oauth dependency to 2.5, run it in dev mode, and access an authenticated page at localhost:3000/progress, the auth workflow fails and the page doesn't render.

For now, I have downgraded to 2.4.2 but it would be great to get a fix for this. Did something change in 2.5 that requires a config change?

evanrlong commented 4 years ago

Also, I can no longer pull back a valid access token on any page (authenticated or not) using this.$store.state.oauth.accessToken in 2.5.

samtgarson commented 4 years ago

Hey @evanrlong we've just fixed an issue introduced in 2.5 when refresh tokens are not provided, please give it another go and let us know here if it's still a problem.