mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(api): 🐛 Fix incorrect OAuth changes
This commit is contained in:
parent
d5076590c6
commit
ddab167018
5 changed files with 26 additions and 27 deletions
|
|
@ -112,25 +112,20 @@ describe("POST /api/auth/login/", () => {
|
|||
describe("GET /oauth/authorize/", () => {
|
||||
test("should get a code", async () => {
|
||||
const response = await sendTestRequest(
|
||||
new Request(
|
||||
new URL(
|
||||
`/oauth/authorize?${new URLSearchParams({
|
||||
client_id,
|
||||
client_secret,
|
||||
redirect_uri: "https://example.com",
|
||||
response_type: "code",
|
||||
scope: "read write",
|
||||
max_age: "604800",
|
||||
})}`,
|
||||
base_url,
|
||||
),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
Cookie: `jwt=${jwt}`,
|
||||
},
|
||||
new Request(new URL(`/oauth/authorize`, base_url), {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Cookie: `jwt=${jwt}`,
|
||||
},
|
||||
),
|
||||
body: new URLSearchParams({
|
||||
client_id,
|
||||
client_secret,
|
||||
redirect_uri: "https://example.com",
|
||||
response_type: "code",
|
||||
scope: "read write",
|
||||
max_age: "604800",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
expect(response.status).toBe(302);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue