Guest User

Untitled

a guest
Jun 27th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { getSession } from 'next-auth/react';
  2. export default async function handler(req, res) {    
  3.     const session = await getSession({ req });
  4.    if (!session) {
  5.     res.status(401).json({ message: "You must be logged in." });
  6.     return;
  7.   }
Advertisement
Add Comment
Please, Sign In to add comment