Next.js Discord

Discord Forum

AuthJS. Weird Production Behaviour

Unanswered
Atlantic menhaden posted this in #help-forum
Open in Discord
Atlantic menhadenOP
Ummmm i'm not entirely sure how to explain this. But 403 shows when user is not logged in. But the user IS logged in. Just weird behaviour which was not happening in testing.

5 Replies

Western paper wasp
You need to post some kind of code or error message or something so that people can understand what’s going on
it’s possible there’s a race condition where your page is loading for the first time before the auth session has been verified or before the cookies have been applied or something like that
@Western paper wasp You need to post some kind of code or error message or something so that people can understand what’s going on
Atlantic menhadenOP
my bad...

the component you're looking at:
https://pastebin.com/nja8HG0G

my _app.js (i've seen some people say this might be the issue?)
https://pastebin.com/JpFs4Gwc

my next auth callback
https://pastebin.com/FZ0uzGiF
@Atlantic menhaden my bad... the component you're looking at: https://pastebin.com/nja8HG0G my _app.js (i've seen some people say this might be the issue?) https://pastebin.com/JpFs4Gwc my next auth callback https://pastebin.com/FZ0uzGiF
Atlantic menhadenOP
managed to fix this by adding refetchOnWindowFocus to the sessionprovider... but it still doesn't work on a lot of other routes
@Atlantic menhaden managed to fix this by adding refetchOnWindowFocus to the sessionprovider... but it still doesn't work on a lot of other routes
Atlantic menhadenOP
Doesn't work when accessing the route directly via the url as opposed to nvigating to it from the root of my app