niahere 0.5.10 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/agent/auth.ts +4 -1
package/package.json
CHANGED
package/src/agent/auth.ts
CHANGED
|
@@ -144,7 +144,10 @@ export function codexAuthStatus(now: number = Date.now(), reader: AuthReader = d
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
const tokens = (auth.tokens ?? {}) as Record<string, unknown>;
|
|
147
|
-
|
|
147
|
+
// access_token is what authenticates. id_token is a short-lived OIDC identity
|
|
148
|
+
// token that lapses about an hour after every refresh, so reading it reports
|
|
149
|
+
// "lapsed" for any healthy install — a permanent false alarm.
|
|
150
|
+
const exp = jwtExpiry(typeof tokens.access_token === "string" ? tokens.access_token : undefined);
|
|
148
151
|
const mode = typeof auth.auth_mode === "string" ? auth.auth_mode : "oauth";
|
|
149
152
|
if (exp === undefined) return { ...base, state: "unknown", detail: `${mode} sign-in, no readable expiry` };
|
|
150
153
|
if (exp <= now) return { ...base, state: "stale", detail: `${mode} token lapsed ${ago(now - exp)} ago, renewable` };
|