fix(common): restore magic-link sign-in flow on cloud for orgs (#6237)

This commit is contained in:
James George 2026-04-28 14:02:50 +05:30 committed by GitHub
parent bb1c9a9fe9
commit df97d11753
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,12 +33,13 @@ export default defineComponent({
async mounted() { async mounted() {
const { redirect, ...queryParams } = this.route.query const { redirect, ...queryParams } = this.route.query
// Org subdomain magic-link flow: redirect back to the originating subdomain // Firebase delivers magic links to the default cloud instance
if ( // (e.g. hoppscotch.io) `/enter` route because `continueUrl` must
platform.organization && // point there for trust-domain verification. Org-subdomain
!platform.organization.isDefaultCloudInstance && // (e.g. subdomain.hoppscotch.io) logins redirect back to the
typeof redirect === "string" // originating subdomain; `getSafeRedirectUrl()` restricts the
) { // target to the default cloud instance domain and its subdomains.
if (platform.organization && typeof redirect === "string") {
const redirectTarget = getSafeRedirectUrl( const redirectTarget = getSafeRedirectUrl(
redirect, redirect,
platform.organization.getRootDomain() platform.organization.getRootDomain()