Skip to content

Commit

Permalink
Avoid redirects to owner login if it's an app logon;
Browse files Browse the repository at this point in the history
  • Loading branch information
stef-coenen authored Nov 29, 2023
1 parent 9dbea80 commit 87412ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/login-app/src/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const storeIdentityAndAuthorize = (identity: string, params?: URLSearchPa
window.location != window.parent.location ? document.referrer : document.location.href;

// Point to owner login if the identity is the same as the host we're on
if (stripIdentity(parentUrl) === identity)
// But don't do this if it's an app running on the owner host
if (stripIdentity(parentUrl) === identity && !window.location.pathname.includes('anonymous-apps'))
window.top.location.href = `https://${identity}/owner/login?returnUrl=/owner`;
else
window.top.location.href = `https://${identity}/api/owner/v1/youauth/authorize?${params?.toString()}`;
Expand Down

0 comments on commit 87412ee

Please sign in to comment.