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
|
||||
return response(null, 302, {
|
||||
Location: new URL(
|
||||
`/oauth/redirect?${searchParams.toString()}`,
|
||||
`/oauth/consent?${searchParams.toString()}`,
|
||||
config.http.base_url,
|
||||
).toString(),
|
||||
// Set cookie with JWT
|
||||
|
|
|
|||
|
|
@ -177,8 +177,8 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
|
|||
|
||||
// Redirect back to application
|
||||
return Response.redirect(
|
||||
`/oauth/redirect?${new URLSearchParams({
|
||||
redirect_uri: flow.application.redirectUris,
|
||||
`/oauth/consent?${new URLSearchParams({
|
||||
redirect_uri: flow.application.redirectUri,
|
||||
code,
|
||||
client_id: flow.application.clientId,
|
||||
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("redirect_uri")).toBe(
|
||||
"https://example.com",
|
||||
|
|
|
|||
Loading…
Reference in a new issue