mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 19:01:19 +00:00
Try logging server session
This commit is contained in:
parent
41dfcb6918
commit
156a1c906f
@ -1,8 +1,12 @@
|
||||
import { getAllUsers, createUser } from '@/db/models/userModels';
|
||||
import { getServerSession } from "next-auth/next"
|
||||
import { authOptions } from "@/api/auth/[...nextauth].js"
|
||||
|
||||
export default async function handler(req, res) {
|
||||
if (req.method === 'GET') {
|
||||
try {
|
||||
const session = await getServerSession(req, res, authOptions)
|
||||
console.log("Session", session)
|
||||
const users = await getAllUsers();
|
||||
res.status(200).json(users);
|
||||
} catch (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user