You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to call a third party API through a server on a use client component and we need to send the Auth0 access token to that API.
When we call to getSession() or getAccessToken() inside that server action all the client have a flickering since the entire document along with the CSS and the fonts we use are reloaded again. If we don't use anything from Auth0 on that server action we don't have that flickering
Screen.Recording.2024-01-24.at.00.09.39.mov
Reproduction
Create a use cliente component.
Create a server action.
Add logic to retrieve the Auth0 access token on the server action.
Call to the server action on the use client component.
There is the flickering and all the files reloaded.
Additional context
No response
nextjs-auth0 version
3.5.0
Next.js version
14.0.4
Node.js version
18.x
The text was updated successfully, but these errors were encountered:
I'm seeing the same, if i remove the auth0 code the response from the server action is tiny, with the auth0 code it returns a much larger response. almost looks like it's returning the entire page.
The flickering probably happens because the css is downloaded and applied again.
julianv97
changed the title
Using Auth0 methods on a Server Action causes a flickering on the NextJS Cliente
Using Auth0 methods on a Server Action causes a flickering on the NextJS Client
Feb 6, 2024
Same issue here, I digged a bit and it is caused by Next.js invalidating path whenever a cookie is set, which auth0 basically do whenever you call getSession I guess to refresh the session cookie
On my side it's making our form unusable as it is, forces us to us API/fetch instead of actions and will probably make me pull out of Auth0 in the long run :(
Checklist
Description
We want to call a third party API through a server on a
use client
component and we need to send the Auth0 access token to that API.When we call to
getSession()
orgetAccessToken()
inside that server action all the client have a flickering since the entire document along with the CSS and the fonts we use are reloaded again. If we don't use anything from Auth0 on that server action we don't have that flickeringScreen.Recording.2024-01-24.at.00.09.39.mov
Reproduction
Additional context
No response
nextjs-auth0 version
3.5.0
Next.js version
14.0.4
Node.js version
18.x
The text was updated successfully, but these errors were encountered: