diff --git a/docs/api/frontend.md b/docs/api/frontend.md index e272ce9e..f4a6b452 100644 --- a/docs/api/frontend.md +++ b/docs/api/frontend.md @@ -7,7 +7,7 @@ The frontend API contains endpoints that are useful for frontend developers. The These routes can be set to a different URL in the Versia Server configuration, at `frontend.routes`. The frontend must implement these routes for the instance to function correctly. - `GET /oauth/authorize`: (NOT `POST`): Identifier/password login form, submits to [`POST /api/auth/login`](#sign-in) or OpenID Connect flow. -- `GET /oauth/consent`: Consent form, submits to [`POST /api/auth/redirect`](#consent) +- `GET /oauth/consent`: Consent form, submits to [`POST /oauth/authorize`](#consent) ## Get Frontend Configuration diff --git a/plugins/openid/routes/authorize.ts b/plugins/openid/routes/authorize.ts index a934ad66..cff8322e 100644 --- a/plugins/openid/routes/authorize.ts +++ b/plugins/openid/routes/authorize.ts @@ -303,7 +303,7 @@ export default (plugin: PluginType) => redirectUri.searchParams.append("code", code); state && redirectUri.searchParams.append("state", state); - return context.redirect(redirectUri.toString()); + return context.redirect(encodeURI(redirectUri.toString())); }, ), );