fix(agent): Allow null refreshToken and expiresAt for setup tokens
Modified OAuthCredentials interface to support setup tokens that don't have refresh tokens or expiry times: - refreshToken: string | null - expiresAt: number | null Updated in both src/agent/accounts/usage.ts and src/agent/credentials/types.ts for consistency. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,3 +48,7 @@ See [docs/testing.md](docs/testing.md) for details.
|
||||
## Documentation Maintenance
|
||||
|
||||
**After every code change, update the relevant docs/ file.** Documentation must stay in sync with implementation. When adding a new module, table, tRPC procedure, component, or CLI command, update the corresponding doc. When refactoring, update affected docs and remove stale information.
|
||||
|
||||
# Committing
|
||||
|
||||
After completing & verifying changes always commit the changes.
|
||||
@@ -16,8 +16,8 @@ const TOKEN_REFRESH_BUFFER_MS = 300_000; // 5 minutes
|
||||
|
||||
export interface OAuthCredentials {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
expiresAt: number; // ms epoch
|
||||
refreshToken: string | null;
|
||||
expiresAt: number | null; // ms epoch, null for setup tokens
|
||||
subscriptionType: string | null;
|
||||
rateLimitTier: string | null;
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
*/
|
||||
export interface OAuthCredentials {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
/** Expiry time in milliseconds since epoch */
|
||||
expiresAt: number;
|
||||
refreshToken: string | null;
|
||||
/** Expiry time in milliseconds since epoch. Null for setup tokens with no expiry. */
|
||||
expiresAt: number | null;
|
||||
subscriptionType: string | null;
|
||||
rateLimitTier: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user