Commit 2a63995
committed
fix(webapp): sign public JWTs with env.apiKey, not the raw header key
During the grace window after an API key rotation, a client calling
/api/v1/auth/jwt with their old (revoked but still valid) key would get
back a JWT that immediately failed validation, because signing used the
header key (old) while validation in jwtAuth.server.ts uses
environment.apiKey (new). Sign with the environment's canonical current
key instead so minted JWTs validate regardless of which accepted key was
used to authenticate the mint call. Works for dev/prod/preview — in the
PREVIEW branch path, findEnvironmentByApiKey already merges the parent's
current apiKey onto the returned env.1 parent d21217d commit 2a63995
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | | - | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
0 commit comments