Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

777 B
Raw Blame
import assert from "node:assert/strict";
import { test } from "node:test";
import fs from "node:fs";
import path from "node:path";

test("login page performs full window.location navigation after authentication to avoid cookie race", () => {
  const loginPagePath = path.resolve(process.cwd(), "src/app/login/page.tsx");
  const content = fs.readFileSync(loginPagePath, "utf8");

  // Ensure router.push("/dashboard") is replaced with window.location.href
  assert.equal(
    content.includes('router.push("/dashboard")'),
    false,
    "LoginPage should not use router.push('/dashboard') after login"
  );
  assert.equal(
    content.includes('window.location.href = "/dashboard"'),
    true,
    "LoginPage must perform full window.location navigation after login"
  );
});