Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

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

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