mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-05-21 01:12:03 +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 { 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) {
|
export default async function handler(req, res) {
|
||||||
if (req.method === 'GET') {
|
if (req.method === 'GET') {
|
||||||
try {
|
try {
|
||||||
|
const session = await getServerSession(req, res, authOptions)
|
||||||
|
console.log("Session", session)
|
||||||
const users = await getAllUsers();
|
const users = await getAllUsers();
|
||||||
res.status(200).json(users);
|
res.status(200).json(users);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user