mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
feat(api): 🐛 Change consent route from /oauth/redirect to /oauth/consent
This commit is contained in:
parent
99822a716d
commit
9834825184
|
|
@ -150,7 +150,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
|
||||||
// Redirect to OAuth authorize with JWT
|
// Redirect to OAuth authorize with JWT
|
||||||
return response(null, 302, {
|
return response(null, 302, {
|
||||||
Location: new URL(
|
Location: new URL(
|
||||||
`/oauth/redirect?${searchParams.toString()}`,
|
`/oauth/consent?${searchParams.toString()}`,
|
||||||
config.http.base_url,
|
config.http.base_url,
|
||||||
).toString(),
|
).toString(),
|
||||||
// Set cookie with JWT
|
// Set cookie with JWT
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,8 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
|
||||||
|
|
||||||
// Redirect back to application
|
// Redirect back to application
|
||||||
return Response.redirect(
|
return Response.redirect(
|
||||||
`/oauth/redirect?${new URLSearchParams({
|
`/oauth/consent?${new URLSearchParams({
|
||||||
redirect_uri: flow.application.redirectUris,
|
redirect_uri: flow.application.redirectUri,
|
||||||
code,
|
code,
|
||||||
client_id: flow.application.clientId,
|
client_id: flow.application.clientId,
|
||||||
application: flow.application.name,
|
application: flow.application.name,
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ describe("POST /api/auth/login/", () => {
|
||||||
"",
|
"",
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(locationHeader.pathname).toBe("/oauth/redirect");
|
expect(locationHeader.pathname).toBe("/oauth/consent");
|
||||||
expect(locationHeader.searchParams.get("client_id")).toBe(client_id);
|
expect(locationHeader.searchParams.get("client_id")).toBe(client_id);
|
||||||
expect(locationHeader.searchParams.get("redirect_uri")).toBe(
|
expect(locationHeader.searchParams.get("redirect_uri")).toBe(
|
||||||
"https://example.com",
|
"https://example.com",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue