File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -186,10 +186,10 @@ export function createHonoApp() {
186186 return c . json ( { status : "ok" , timestamp : new Date ( ) . toISOString ( ) } ) ;
187187 } ) ;
188188
189- // Guest JWT JWKS endpoint — public, cacheable, no auth required.
189+ // Guest JWT JWKS endpoint — public, no auth required, avoid edge caching .
190190 // Convex uses this to verify guest JWTs natively.
191191 app . get ( "/guest/jwks" , ( c ) => {
192- c . header ( "Cache-Control" , "public, max-age=3600 " ) ;
192+ c . header ( "Cache-Control" , "no-store " ) ;
193193 return c . json ( getGuestJwks ( ) ) ;
194194 } ) ;
195195
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ describe("GET /api/web/guest-jwks", () => {
4242 rmSync ( testGuestKeyDir , { recursive : true , force : true } ) ;
4343 } ) ;
4444
45- it ( "returns a public, cacheable JWKS document" , async ( ) => {
45+ it ( "returns a non- cacheable JWKS document" , async ( ) => {
4646 const response = await app . request ( "/api/web/guest-jwks" ) ;
4747
4848 expect ( response . status ) . toBe ( 200 ) ;
49- expect ( response . headers . get ( "cache-control" ) ) . toBe ( "public, max-age=3600 " ) ;
49+ expect ( response . headers . get ( "cache-control" ) ) . toBe ( "no-store " ) ;
5050 expect ( response . headers . get ( "content-type" ) ) . toContain ( "application/json" ) ;
5151
5252 const body = await response . json ( ) ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ web.route("/guest-session", guestSession);
3939
4040// Public JWKS endpoint for guest JWT verification.
4141web . get ( "/guest-jwks" , ( c ) => {
42- c . header ( "Cache-Control" , "public, max-age=3600 " ) ;
42+ c . header ( "Cache-Control" , "no-store " ) ;
4343 return c . json ( getGuestJwks ( ) ) ;
4444} ) ;
4545
You can’t perform that action at this time.
0 commit comments