mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 11:12:17 +03:00
fix(types): narrow refresh token rotation inputs (#10257)
This commit is contained in:
@@ -112,8 +112,8 @@ export async function serializeRefresh<T>(provider: string, fn: () => Promise<T>
|
||||
* and codex-lb's replica race-detection.
|
||||
*/
|
||||
export function wasRefreshTokenRotated(
|
||||
attemptedRefreshToken: string | null | undefined,
|
||||
latestRefreshToken: string | null | undefined
|
||||
attemptedRefreshToken: unknown,
|
||||
latestRefreshToken: unknown
|
||||
): boolean {
|
||||
return (
|
||||
typeof attemptedRefreshToken === "string" &&
|
||||
|
||||
@@ -109,4 +109,6 @@ test("wasRefreshTokenRotated: true only when the DB token changed to a non-empty
|
||||
assert.equal(wasRefreshTokenRotated("rt-old", ""), false, "empty DB token = deactivate");
|
||||
assert.equal(wasRefreshTokenRotated(null, "rt-new"), false, "unknown attempted = deactivate");
|
||||
assert.equal(wasRefreshTokenRotated(undefined, undefined), false);
|
||||
assert.equal(wasRefreshTokenRotated("rt-old", { token: "rt-new" }), false);
|
||||
assert.equal(wasRefreshTokenRotated(42, "rt-new"), false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user