Merged in fix/cache-service-token (pull request #1571)

fix(servicetoken): cache it when using unstable_cache

* fix(servicetoken): cache it when using unstable_cache

* Refactor and using cacheOrGet as get/set

* Refactor

* Use expiresAt from cached token


Approved-by: Anton Gunnarsson
This commit is contained in:
Linus Flood
2025-03-19 09:16:11 +00:00
parent 8d1e9954d4
commit dd3fed9423
3 changed files with 34 additions and 20 deletions

View File

@@ -139,7 +139,6 @@ export const safeProtectedProcedure = baseProcedure.use(async function (opts) {
export const serviceProcedure = baseProcedure.use(async (opts) => {
const token = await getServiceToken()
console.log("[DEBUG] token", typeof token, token)
const { access_token } = token
if (!access_token) {
throw internalServerError(`[serviceProcedure] No service token`)