Merged in revert-pr-1925 (pull request #1927)

Revert "Feat/sw 2323 find booking (pull request #1925)"

Approved-by: Anton Gunnarsson
This commit is contained in:
Linus Flood
2025-05-02 13:05:42 +00:00
parent 87efb72ff2
commit 6979ac0c3b
69 changed files with 883 additions and 1508 deletions
-11
View File
@@ -3,9 +3,7 @@ import { trace, type Tracer } from "@opentelemetry/api"
import { env } from "@/env/server"
import { createCounter } from "@/server/telemetry"
import { auth } from "@/auth"
import { getCacheClient } from "@/services/dataCache"
import { isValidSession } from "@/utils/session"
import type { ServiceTokenResponse } from "@/types/tokens"
@@ -119,12 +117,3 @@ async function fetchServiceToken(scopes: string[]) {
function getServiceTokenCacheKey(scopes: string[]): string {
return `serviceToken:${scopes.join(",")}`
}
export async function getUserOrServiceToken() {
const serviceToken = await getServiceToken()
const session = await auth()
return isValidSession(session)
? session.token.access_token
: serviceToken.access_token
}