aborn / nuxt-openid-connect

OpenID-Connect(OIDC) integration module for nuxt 3.0.
31 stars 16 forks source link

Error accessing access_token in callback #22

Closed painerp closed 1 year ago

painerp commented 1 year ago

Hi,

Thanks for the great tool! I attempted to use it with the latest version of Nuxt (3.6.1) and integrated Authentik as the OIDC provider. However, I encountered some issues during the process.

Here's the problematic output I received when I enabled debugging:

[CALLBACK]: has access_token in params, accessToken:eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc2Y2FlZThhMjIxNTVm...
[CALLBACK]: TypeError: Cannot read properties of null (reading 'access_token')

In my understanding, it seems like this issue arose when the support for refresh_token was added, although I'm not entirely certain. The problem appears to be that tokenSet is set to null in callback.ts, yet setCookieTokenAndRefreshToken still attempts to access the access_token without taking this into consideration. The error occurs at the following line: link to the problematic line.

Thank you for taking the time to look into this matter.

rkorzhoff commented 1 year ago

@aborn can you release this fix please?

aborn commented 1 year ago

@aborn can you release this fix please?

done, version 0.6.2