diegosouzapw/OmniRoute · error · AgyAuthFileError
missing_refresh_token
missing_refresh_token
Error message
refresh_token is missing or empty in the agy token file
What it means
Error "refresh_token is missing or empty in the agy token file" thrown in diegosouzapw/OmniRoute.
Source
Thrown at src/lib/oauth/utils/agyAuthImport.ts:87
*/
export function parseAndValidateAgyToken(raw: unknown): ParsedAgyAuth {
const doc = toRecord(raw);
// agy nests credentials under `.token`; fall back to the top level for flat exports.
const token = doc.token && typeof doc.token === "object" ? toRecord(doc.token) : doc;
const accessToken = toNonEmptyString(token.access_token);
const refreshToken = toNonEmptyString(token.refresh_token);
if (!accessToken) {
throw new AgyAuthFileError(
"access_token is missing or empty in the agy token file",
400,
"missing_access_token"
);
}
if (!refreshToken) {
throw new AgyAuthFileError(
"refresh_token is missing or empty in the agy token file",
400,
"missing_refresh_token"
);
}
// agy uses an ISO `expiry`; also accept a unix-ms `expiry_date`/`expires_at` for safety.
let expiresAt: string | null = null;
const isoExpiry = toNonEmptyString(token.expiry) ?? toNonEmptyString(token.expires_at);
if (isoExpiry) {
const ms = new Date(isoExpiry).getTime();
expiresAt = Number.isNaN(ms) ? null : new Date(ms).toISOString();
} else if (typeof token.expiry_date === "number" && Number.isFinite(token.expiry_date)) {
expiresAt = new Date(token.expiry_date).toISOString();
}
const tokenType = toNonEmptyString(token.token_type) ?? "Bearer";
const authMethod = toNonEmptyString(doc.auth_method) ?? toNonEmptyString(token.auth_method);View on GitHub (pinned to a179ffed5b)
When it happens
Trigger: Thrown at src/lib/oauth/utils/agyAuthImport.ts:87 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/0a031b7dc69f55d9.
Report an issue: GitHub.