how do i protect route handlers with nextauth as well as get session data in those routes
Unanswered
English Lop posted this in #help-forum
English LopOP
all in title, im very confused
2 Replies
SahLozk
const session = await getServerSession(authOptions);
const role = session?.user.role;
const token = session?.user.token;
and
const { data: session } = useSession();
const role = session?.user.role;
const token = session?.user.token;