(overrides: Partial<StoredCodexAuth> = {})
| 23 | } |
| 24 | |
| 25 | function baseAuth(overrides: Partial<StoredCodexAuth> = {}): StoredCodexAuth { |
| 26 | return { |
| 27 | schemaVersion: 1, |
| 28 | accessToken: 'acc-1', |
| 29 | refreshToken: 'ref-1', |
| 30 | idToken: ID_TOKEN_WITH_EMAIL, |
| 31 | expiresAt: NOW + 60 * 60 * 1000, |
| 32 | accountId: 'acct-1', |
| 33 | email: 'user@example.com', |
| 34 | updatedAt: NOW, |
| 35 | ...overrides, |
| 36 | }; |
| 37 | } |
| 38 | |
| 39 | function makeStore(overrides: Partial<CodexTokenStoreOptions> = {}, sub?: string) { |
| 40 | const filePath = overrides.filePath ?? tempPath(sub); |