#useSession() from NextAuth fails
34 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
where are you using Token function
in a file

lol im trying to export it as a module
i could also just import a function that runs the checks im trying to run but i wanted to test this^
rename Token to useToken
did that and got same error
ok let me see where you are using your Token function
you cant do that
why nawt
because rule of hooks
i dont get which rule im breaking tho
you can't use hooks outside of a react component
nextauth also doesnt let you return user's session in server call so oh well
getserversession only returns boolean no?
idk where you get that from
you can just pass in the authOption on the first parameter, no need request or response, those are for pages dir
it has minor differences but yes it should return the same crucial data
well now im just getting a freaking loader issue
even tho i changed none of my packages
But using it inside a react component works right?
yeah i got the session
also that using getServerSession() in Server Component works right?
can you resolve the post
allright thanks