fix: 🔥 Remove old tests and docs related to old auth endpoints

This commit is contained in:
Jesse Wierzbinski 2025-11-21 06:45:12 +01:00
parent ae207c10b6
commit a9dbd2cc4e
No known key found for this signature in database
3 changed files with 5 additions and 83 deletions

View file

@ -1,12 +1,7 @@
import { afterAll, describe, expect, test } from "bun:test";
import {
fakeRequest,
generateClient,
getTestUsers,
} from "@versia-server/tests";
import { generateClient, getTestUsers } from "@versia-server/tests";
let clientId: string;
const { users, passwords, deleteUsers } = await getTestUsers(1);
const { users, deleteUsers } = await getTestUsers(1);
afterAll(async () => {
await deleteUsers();
@ -33,27 +28,6 @@ describe("Login flow", () => {
redirect_uris: ["https://example.com"],
scopes: ["read", "write"],
});
clientId = data.client_id;
});
test("should get a JWT", async () => {
const formData = new FormData();
formData.append("identifier", users[0]?.data.email ?? "");
formData.append("password", passwords[0]);
const response = await fakeRequest(
`/api/auth/login?client_id=${clientId}&redirect_uri=https://example.com&response_type=code&scope=read+write`,
{
method: "POST",
body: formData,
},
);
expect(response.status).toBe(302);
//jwt = response.headers.get("Set-Cookie")?.match(/jwt=([^;]+);/)?.[1] ?? "";
});
// TODO: Test full flow including OpenID part