File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
packages/service-utils/src Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @thirdweb-dev/service-utils " : patch
3+ ---
4+
5+ [ service-utils] fix auth for cf workers
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ import type {
66import type { Request } from "@cloudflare/workers-types" ;
77import type { CoreServiceConfig , TeamAndProjectResponse } from "../core/api.js" ;
88import { authorize } from "../core/authorize/index.js" ;
9- import type { AuthorizationInput } from "../core/authorize/index.js" ;
9+ import type {
10+ AuthorizationInput ,
11+ TeamAndProjectCacheWithPossibleTTL ,
12+ } from "../core/authorize/index.js" ;
1013import type { AuthorizationResult } from "../core/authorize/types.js" ;
1114import type { CoreAuthInput } from "../core/types.js" ;
1215
@@ -54,14 +57,14 @@ export async function authorizeWorker(
5457
5558 return await authorize ( authData , serviceConfig , {
5659 get : async ( clientId : string ) => serviceConfig . kvStore . get ( clientId ) ,
57- put : ( clientId : string , data : TeamAndProjectResponse ) =>
60+ put : ( clientId : string , teamAndProjectResponse : TeamAndProjectResponse ) =>
5861 serviceConfig . ctx . waitUntil (
5962 serviceConfig . kvStore . put (
6063 clientId ,
6164 JSON . stringify ( {
6265 updatedAt : Date . now ( ) ,
63- data ,
64- } ) ,
66+ teamAndProjectResponse ,
67+ } satisfies TeamAndProjectCacheWithPossibleTTL ) ,
6568 {
6669 expirationTtl :
6770 serviceConfig . cacheTtlSeconds &&
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export type CacheOptions = {
2828 cacheTtlSeconds : number ;
2929} ;
3030
31- type TeamAndProjectCacheWithPossibleTTL =
31+ export type TeamAndProjectCacheWithPossibleTTL =
3232 | {
3333 teamAndProjectResponse : TeamAndProjectResponse ;
3434 updatedAt : number ;
You can’t perform that action at this time.
0 commit comments