✅ – Adi – 11-00 Jan 23
[How to secure API routes in Nextjs]
5 Replies
I am using this code snippet:
I am getting error:
getSession) is not a function
I used import { getSession } from "next-auth/client";
still it did not work. Any idea what I am missing?get session is for client side
Solution
you need to use getserversession
This question has an answer! Thank you for helping 😄
If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1067035979904458793
This thread hasn’t had any activity in 12 hours, so it’s now locked.
Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1067035979904458793
Question not getting answered? Maybe it's hard to answer, or maybe you asked at a slow time. Check out these resources for help asking a good question:
https://stackoverflow.com/help/how-to-ask
http://wp.me/p2oIwo-26