fix: redirect from oauth2 authorization page (#12241)

At the moment it just says "you are not authorized", but we want to
automatically redirect to the login page.
This commit is contained in:
Asher
2024-02-21 13:30:33 -09:00
committed by GitHub
parent c3a7b13690
commit 7eb2beccea
3 changed files with 30 additions and 15 deletions
+4 -3
View File
@@ -25,7 +25,8 @@ export const LoginPage: FC = () => {
// If the redirect is going to a workspace application, and we
// are missing authentication, then we need to change the href location
// to trigger a HTTP request. This allows the BE to generate the auth
// cookie required.
// cookie required. Similarly for the OAuth2 exchange as the authorization
// page is served by the backend.
// If no redirect is present, then ignore this branched logic.
if (redirectTo !== "" && redirectTo !== "/") {
try {
@@ -39,8 +40,8 @@ export const LoginPage: FC = () => {
} catch {
// Do nothing
}
// Path based apps.
if (redirectTo.includes("/apps/")) {
// Path based apps and OAuth2.
if (redirectTo.includes("/apps/") || redirectTo.includes("/oauth2/")) {
window.location.href = redirectTo;
return null;
}