Merged in fix/include-service-token-in-debug-data (pull request #2903)

fix: include service token in the debug route

* fix: include service token in the debug route


Approved-by: Bianca Widstam
Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
Joakim Jäderberg
2025-10-03 13:16:51 +00:00
parent 9292c437f4
commit 0e0efa48a8

View File

@@ -1,6 +1,8 @@
import { notFound } from "next/navigation" import { notFound } from "next/navigation"
import { NextResponse } from "next/server" import { NextResponse } from "next/server"
import { getServiceToken } from "@scandic-hotels/common/tokenManager"
import { env } from "@/env/server" import { env } from "@/env/server"
import { auth } from "@/auth" import { auth } from "@/auth"
@@ -11,6 +13,8 @@ export const GET = async () => {
} }
const user = await auth() const user = await auth()
const serviceToken = await getServiceToken()
const sortedEnv = Object.keys(env) const sortedEnv = Object.keys(env)
.sort() .sort()
.reduce<Record<string, unknown>>((acc, key) => { .reduce<Record<string, unknown>>((acc, key) => {
@@ -18,5 +22,5 @@ export const GET = async () => {
return acc return acc
}, {}) }, {})
return NextResponse.json({ user, env: sortedEnv }) return NextResponse.json({ user, serviceToken, env: sortedEnv })
} }