Automatic Server Action on Page?
Unanswered
Vap0r1ze posted this in #help-forum
Vap0r1zeOP
I have an
My problem is that it seems to need to be in a server action, and I cant just call it from
auth/popup/page.tsx that I want to immediately call signIn from auth.js (v5)My problem is that it seems to need to be in a server action, and I cant just call it from
useEffect since the page is a server component. Ideally a good solution would call this method during server-side rendering so that this is 1 network call instead of 2 like putting it in a client component would. Any ideas?4 Replies
Common House-Martin
If you're trying to get the session from a server component you might try to get it from this maybe? https://next-auth.js.org/getting-started/example
Vap0r1zeOP
im not trying to get a session im trying to trigger a sign-in flow
i have a sign-in button, and that opens a popup to
/auth/popup which needs to trigger a signin flowalso keep in mind this is next-auth v5 so their docs are incomplete but located here https://authjs.dev/guides/upgrade-to-v5