feat(api): 🐛 Change consent route from /oauth/redirect to /oauth/consent

This commit is contained in:
Jesse Wierzbinski 2024-04-21 21:36:45 -10:00
parent 99822a716d
commit 9834825184
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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,

View file

@ -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",