Commit c5c2a15
authored
fix(openscience): safe logout ordering + seed synced-secret set at boot (#128)
- clearSession() removes the synced credential artifacts (synced-env.json,
openscience-synced.json) and unsets the env BEFORE deleting the session
file. A crash after unlinking the session but before removing synced-env.json
otherwise left preload-env.ts replaying the managed thk_ key on the next boot,
so the signed-out account's wallet kept being debited. (#37)
- Seed syncedSecretValues from the on-disk snapshot at import. preload-env.ts
replays synced-env.json into process.env but never seeded this set, so on a
fresh process where no in-process sync runs (the common steady state) the set
was empty and a disk-replayed synced secret that isn't a thk_ value was
neither stripped from subprocess env nor masked by redactSecrets(). (#20)1 parent 46104c9 commit c5c2a15
1 file changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
64 | 85 | | |
65 | 86 | | |
66 | 87 | | |
| |||
519 | 540 | | |
520 | 541 | | |
521 | 542 | | |
522 | | - | |
523 | | - | |
524 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
525 | 548 | | |
526 | 549 | | |
527 | 550 | | |
| |||
536 | 559 | | |
537 | 560 | | |
538 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
539 | 566 | | |
540 | 567 | | |
541 | 568 | | |
| |||
0 commit comments