返回 DeepSeek-Reasonix
auth.test.ts
根目录 / workers / accounts / src / routes / auth.test.ts
1 import { describe, expect, it } from "vitest";
2 import { verifyLink } from "./auth";
3
4 describe("verifyLink", () => {
5 it("uses the configured account origin instead of the web app origin", () => {
6 expect(verifyLink("https://id.reasonix.io", "test-token")).toBe(
7 "https://id.reasonix.io/auth/verify?token=test-token",
8 );
9 });
10
11 it("normalizes a trailing slash and encodes the token", () => {
12 expect(verifyLink("https://id.reasonix.io/", "token+/=?")).toBe(
13 "https://id.reasonix.io/auth/verify?token=token%2B%2F%3D%3F",
14 );
15 });
16 });
17
17 lines TYPESCRIPT