mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix: 🔥 Remove old tests and docs related to old auth endpoints
This commit is contained in:
parent
ae207c10b6
commit
a9dbd2cc4e
3 changed files with 5 additions and 83 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue