diff --git a/apps/web/modules/auth/oauth2/authorize-view.tsx b/apps/web/modules/auth/oauth2/authorize-view.tsx index bcc7554c8e..f528d2d2ae 100644 --- a/apps/web/modules/auth/oauth2/authorize-view.tsx +++ b/apps/web/modules/auth/oauth2/authorize-view.tsx @@ -157,7 +157,13 @@ export default function Authorize() { className="mr-2" color="minimal" onClick={() => { - window.location.href = `${client.redirectUri}`; + const separator = client.redirectUri.includes("?") ? "&" : "?"; + const params = new URLSearchParams(); + params.set("error", "access_denied"); + if (state) { + params.set("state", state); + } + window.location.href = `${client.redirectUri}${separator}${params.toString()}`; }}> {t("go_back")}