-
Looking at the docs it says the proper way to secure the endpoints is like so, import { getSession } from 'next-auth/client'
export default async (req, res) => {
const session = await getSession({ req })
if (session) {
// Signed in
console.log('Session', JSON.stringify(session, null, 2))
} else {
// Not Signed in
res.status(401)
}
res.end()
} From the frontend since the browser has the sessions already saved and setup, making requests to secured endpoints works from there. How then do I setup POSTMAN to have access to that session so my requests work? I tried googling for an answer but I could not find one. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hmm. I tried an approach earlier of copying over the |
Beta Was this translation helpful? Give feedback.
Hmm. I tried an approach earlier of copying over the
next-auth.session-token
cookie from the browser over to Postman but it didn't work. Woke up, someone suggested I do that again, so I did and it worked.