Proper guide to implement NextJS authentication? #75567
Unanswered
siamahnaf
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I read the nextjs authentication docs creating session, middleware session check (We need to prevent database check here), and use data access layer for checking. I understand everything.
But I am not getting any information about update session or refreshing session. But I find a small things on their docs-
https://nextjs.org/docs/app/building-your-application/authentication#updating-or-refreshing-sessions
Here they give a function like-
But I am not understanding from where I need to call this function.
If I call it from
middleware,server-action, and orroute-handlerit should work. But it should not work fromServer Component.So an api call from
server-componentwhich one verify session and find that session is expired, then what will be happen?Please give me some suggestions here, Please help me?
Beta Was this translation helpful? Give feedback.
All reactions