diegosouzapw/OmniRoute · error · ClaudeAuthFileError
reauth_required
reauth_required
Error message
Claude connection is missing refresh_token. Re-authenticate this account before exporting.
What it means
Second buildClaudeAuthPayload guard: accessToken exists but refreshToken is empty on the Claude connection. credentials.json must contain a refresh token for the CLI to renew the session, so the 409 error blocks export until the account is re-authenticated (refresh tokens are only minted by a fresh OAuth login).
Solutions
- Re-authenticate the Claude account through the OAuth flow to mint a new refresh token
- Retry the export after the connection stores a refreshToken
- Check whether an earlier refresh rotated and blanked the stored refresh token
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/lib/oauth/utils/claudeAuthFile.ts:135 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/ec1d43da69fc63f1.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/oauth/utils/claudeAuthFile.ts:135
toNonEmptyString(connection.email) ||
toNonEmptyString(connection.displayName)
);
}
export function buildClaudeAuthPayload(connection: ClaudeConnectionLike): ClaudeAuthFilePayload {
const accessToken = toNonEmptyString(connection.accessToken);
const refreshToken = toNonEmptyString(connection.refreshToken);
if (!accessToken) {
throw new ClaudeAuthFileError(
"Claude connection is missing access_token. Refresh or re-authenticate this account first.",
409,
"access_token_missing"
);
}
if (!refreshToken) {
throw new ClaudeAuthFileError(
"Claude connection is missing refresh_token. Re-authenticate this account before exporting.",
409,
"reauth_required"
);
}
// expiresAt in DB is ISO string; the file format expects ms epoch
const expiresAtMs = connection.expiresAt ? new Date(connection.expiresAt).getTime() : 0;
const psd = toRecord(connection.providerSpecificData);
const rawScopes = psd.scopes;
const scopes: string[] = Array.isArray(rawScopes)
? rawScopes.filter((s): s is string => typeof s === "string")
: [];
const payload: ClaudeAuthFilePayload = {
claudeAiOauth: {View on GitHub (pinned to a179ffed5b)