Nuxt Auth
Hi,
I am currently struggling with implementing OAuth2 for my application. I have added @sidebase/nuxt-auth with a NuxtAuthHandler with Authentik as following:
The defined callbacks functions allow me to use the accessToken from Authentik in the frontend and therefore as a header in useFetch to my external (Spring Boot) API.
The problem I have is the accessToken being valid for only 5 minutes by default. However @sidebase/nuxt-auth doesn't recognise this. The state keeps staying on "authenticated", and the accessToken doesn't get refreshed in any way. The user has to sign out completely and then sign in again to get a new accessToken for the next 5 minutes. Of course I could increase the accessToken lifetime, but that wouldn't fix the bad user experience.
How can I fix this problem, or what am I doing wrong here?
I am currently struggling with implementing OAuth2 for my application. I have added @sidebase/nuxt-auth with a NuxtAuthHandler with Authentik as following:
The defined callbacks functions allow me to use the accessToken from Authentik in the frontend and therefore as a header in useFetch to my external (Spring Boot) API.
The problem I have is the accessToken being valid for only 5 minutes by default. However @sidebase/nuxt-auth doesn't recognise this. The state keeps staying on "authenticated", and the accessToken doesn't get refreshed in any way. The user has to sign out completely and then sign in again to get a new accessToken for the next 5 minutes. Of course I could increase the accessToken lifetime, but that wouldn't fix the bad user experience.
How can I fix this problem, or what am I doing wrong here?