Feature/wrap logging * feat: change all logging to go through our own logger function so that we can control log levels * move packages/trpc to using our own logger * merge Approved-by: Linus Flood
19 lines
425 B
TypeScript
19 lines
425 B
TypeScript
import { notFound } from "next/navigation"
|
|
import { NextResponse } from "next/server"
|
|
|
|
import { logger } from "@scandic-hotels/common/logger"
|
|
|
|
import { env } from "@/env/server"
|
|
|
|
import { auth } from "@/auth"
|
|
|
|
export const GET = async () => {
|
|
if (env.NODE_ENV !== "development") {
|
|
return notFound()
|
|
}
|
|
|
|
const user = await auth()
|
|
logger.debug("[DEBUG] access-token", user?.token)
|
|
return NextResponse.json(user)
|
|
}
|