diff --git a/__tests__/login.test.ts b/__tests__/login.test.ts index 924323a..9c957de 100644 --- a/__tests__/login.test.ts +++ b/__tests__/login.test.ts @@ -175,6 +175,27 @@ describe('credential selection', () => { clientId: 'aa_client_trial', }); }); + + it('saves a trial key from a signup response without the retired claim fields', async () => { + const homeDir = await tempDir(); + const ctx = commandContext(homeDir, async () => json({ + secret: 'aa_live_trial', + keyId: 'key_trial', + capUsd: 0.15, + expiresAt: '2026-08-09T12:00:00.000Z', + clientId: 'aa_client_trial', + })); + + await signupCommand(ctx, {}); + + expect(await readConfig(getConfigPath(homeDir))).toEqual({ + apiKey: 'aa_live_trial', + keyId: 'key_trial', + capUsd: 0.15, + expiresAt: '2026-08-09T12:00:00.000Z', + clientId: 'aa_client_trial', + }); + }); }); describe('device token polling', () => { diff --git a/src/types.ts b/src/types.ts index 5d5a7d3..3d0ee5c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -22,7 +22,7 @@ export interface SignupResponse { secret: string; keyId: string; capUsd: number; - verificationStatus: string; + verificationStatus?: string; expiresAt: string; clientId?: string; upgrade?: SignupUpgrade;