Commit 09bfef2
committed
fix(clerk-js): discard a stored session token that was never a mint
`validateToken` documented that a value which could not have come from a mint of
ours is discarded, but only checked type, length and expiry — so a corrupt or
truncated store entry counted as fresh and suppressed acquisition until it
expired, up to the lifetime ceiling.
This is hygiene, not a security boundary, and is deliberately not framed as one:
only the backend can tell a real token from a well-formed forgery, and anything
that can write the store can send the same values to the API directly. What it
buys is that a broken entry starts a fresh run immediately.
The shape is matched version-agnostically. Pinning it to the current version
would mean an SDK rejecting a token the backend had minted ahead of it, and
re-running the loader on every page load until the SDK caught up — a test guards
against that tightening.1 parent ed13b06 commit 09bfef2
2 files changed
Lines changed: 44 additions & 1 deletion
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
386 | 419 | | |
387 | 420 | | |
388 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
245 | 250 | | |
246 | 251 | | |
247 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
248 | 258 | | |
249 | 259 | | |
250 | | - | |
| 260 | + | |
251 | 261 | | |
252 | 262 | | |
253 | 263 | | |
| |||
0 commit comments