From 60debd66d917cf9f9e0e1f95b2e0b8d416de7ba9 Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Thu, 15 Jan 2026 02:32:19 +0530 Subject: [PATCH 1/4] fix: new signup redirect for staging and development --- app/constants/urls.js | 2 +- app/services/login.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/constants/urls.js b/app/constants/urls.js index f3fafe3c..38bc6030 100644 --- a/app/constants/urls.js +++ b/app/constants/urls.js @@ -33,7 +33,7 @@ const APP_URLS = { DASHBOARD: `${SCHEME}staging-dashboard.${DOMAIN}`, }, development: { - HOME: '/', + HOME: `${SCHEME}dev.${DOMAIN}`, WELCOME: `${SCHEME}staging-welcome.${DOMAIN}`, GOTO: '/goto', EVENTS: '/events', diff --git a/app/services/login.js b/app/services/login.js index ded53ded..26b47ebc 100644 --- a/app/services/login.js +++ b/app/services/login.js @@ -31,7 +31,12 @@ export default class LoginService extends Service { throw response; }) .then((user) => { - if (user.incompleteUserDetails && !this.featureFlag.isDevMode) + const currentPath = window.location.pathname; + if ( + user.incompleteUserDetails && + !this.featureFlag.isDevMode && + currentPath !== '/new-signup' + ) window.location.replace(AUTH.SIGN_UP); this.isLoggedIn = true; this.userData = user; From d732af00eeb969d4e77d9ad57815b53f199710be Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Thu, 15 Jan 2026 19:07:35 +0530 Subject: [PATCH 2/4] fix: add signup for test environment --- app/constants/urls.js | 6 +++++- app/services/login.js | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/constants/urls.js b/app/constants/urls.js index 38bc6030..48d8f7d8 100644 --- a/app/constants/urls.js +++ b/app/constants/urls.js @@ -17,6 +17,7 @@ const APP_URLS = { MY_STATUS: `${SCHEME}${DOMAIN}/status`, API_BACKEND: `${SCHEME}api.${DOMAIN}`, DASHBOARD: `${SCHEME}dashboard.${DOMAIN}`, + SIGN_UP: `${SCHEME}${DOMAIN}/new-signup`, }, staging: { HOME: `${SCHEME}staging-www.${DOMAIN}`, @@ -31,6 +32,7 @@ const APP_URLS = { MY_STATUS: `${SCHEME}staging-www.${DOMAIN}/status`, API_BACKEND: `${SCHEME}staging-api.${DOMAIN}`, DASHBOARD: `${SCHEME}staging-dashboard.${DOMAIN}`, + SIGN_UP: `${SCHEME}staging-www.${DOMAIN}/new-signup`, }, development: { HOME: `${SCHEME}dev.${DOMAIN}`, @@ -45,6 +47,7 @@ const APP_URLS = { MY_STATUS: '/status', DASHBOARD: `${SCHEME}staging-dashboard.${DOMAIN}`, API_BACKEND: `${SCHEME}staging-api.${DOMAIN}`, + SIGN_UP: `${SCHEME}dev.${DOMAIN}/new-signup`, }, test: { HOME: `${SCHEME}${DOMAIN}`, @@ -59,6 +62,7 @@ const APP_URLS = { MY_STATUS: `${SCHEME}${DOMAIN}/status`, API_BACKEND: `${SCHEME}staging-api.${DOMAIN}`, DASHBOARD: `${SCHEME}staging-dashboard.${DOMAIN}`, + SIGN_UP: '/new-signup', }, }; @@ -73,7 +77,7 @@ export const ABOUT = { export const AUTH = { GITHUB_SIGN_IN: `${APPS.API_BACKEND}/auth/github/login`, GOOGLE_SIGN_IN: `${APPS.API_BACKEND}/auth/google/login?dev=true`, - SIGN_UP: `${APPS.HOME}/new-signup`, + SIGN_UP: APPS.SIGN_UP, }; export const SOCIALS = { diff --git a/app/services/login.js b/app/services/login.js index 26b47ebc..60c84dd4 100644 --- a/app/services/login.js +++ b/app/services/login.js @@ -31,13 +31,14 @@ export default class LoginService extends Service { throw response; }) .then((user) => { - const currentPath = window.location.pathname; if ( user.incompleteUserDetails && !this.featureFlag.isDevMode && - currentPath !== '/new-signup' - ) + !this.fastboot.isFastBoot && + window.location.pathname !== '/new-signup' + ) { window.location.replace(AUTH.SIGN_UP); + } this.isLoggedIn = true; this.userData = user; }) From 9df16b3b59973ee780202866ef346b6bd0ea849b Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Thu, 15 Jan 2026 19:40:57 +0530 Subject: [PATCH 3/4] fix: add login stub for redirect in test module --- tests/unit/routes/debug-test.js | 11 +++++++++++ tests/unit/routes/live-test.js | 11 +++++++++++ tests/unit/routes/login-test.js | 11 +++++++++++ tests/unit/routes/page-not-found-test.js | 12 ++++++++++++ 4 files changed, 45 insertions(+) diff --git a/tests/unit/routes/debug-test.js b/tests/unit/routes/debug-test.js index 63c2f669..08015350 100644 --- a/tests/unit/routes/debug-test.js +++ b/tests/unit/routes/debug-test.js @@ -1,10 +1,21 @@ import { module, test } from 'qunit'; import { setupTest } from 'website-www/tests/helpers'; import { visit } from '@ember/test-helpers'; +import Service from '@ember/service'; + +class LoginStub extends Service { + isLoading = false; + isLoggedIn = false; + userData = null; +} module('Unit | Route | debug', function (hooks) { setupTest(hooks); + hooks.beforeEach(function () { + this.owner.register('service:login', LoginStub); + }); + test('it exists', function (assert) { let route = this.owner.lookup('route:debug'); assert.ok(route); diff --git a/tests/unit/routes/live-test.js b/tests/unit/routes/live-test.js index da8239e7..a81a7dab 100644 --- a/tests/unit/routes/live-test.js +++ b/tests/unit/routes/live-test.js @@ -1,9 +1,20 @@ import { module, test } from 'qunit'; import { setupTest } from 'website-www/tests/helpers'; import { visit } from '@ember/test-helpers'; +import Service from '@ember/service'; + +class LoginStub extends Service { + isLoading = false; + isLoggedIn = false; + userData = null; +} module('Unit | Route | live', function (hooks) { setupTest(hooks); + + hooks.beforeEach(function () { + this.owner.register('service:login', LoginStub); + }); // TODO - remove tests for dev mode when it goes to prod test('it exists', function (assert) { let route = this.owner.lookup('route:live'); diff --git a/tests/unit/routes/login-test.js b/tests/unit/routes/login-test.js index 253d0cec..81747fa7 100644 --- a/tests/unit/routes/login-test.js +++ b/tests/unit/routes/login-test.js @@ -1,10 +1,21 @@ import { module, test } from 'qunit'; import { setupTest } from 'website-www/tests/helpers'; import { visit, currentURL } from '@ember/test-helpers'; +import Service from '@ember/service'; + +class LoginStub extends Service { + isLoading = false; + isLoggedIn = false; + userData = null; +} module('Unit | Route | login', function (hooks) { setupTest(hooks); + hooks.beforeEach(function () { + this.owner.register('service:login', LoginStub); + }); + test('it exists', function (assert) { let route = this.owner.lookup('route:login'); assert.ok(route); diff --git a/tests/unit/routes/page-not-found-test.js b/tests/unit/routes/page-not-found-test.js index f2384c33..9598fc90 100644 --- a/tests/unit/routes/page-not-found-test.js +++ b/tests/unit/routes/page-not-found-test.js @@ -1,9 +1,21 @@ import { module, test } from 'qunit'; import { setupTest } from 'website-www/tests/helpers'; import { visit } from '@ember/test-helpers'; +import Service from '@ember/service'; + +class LoginStub extends Service { + isLoading = false; + isLoggedIn = false; + userData = null; +} + module('Unit | Route | page-not-found', function (hooks) { setupTest(hooks); + hooks.beforeEach(function () { + this.owner.register('service:login', LoginStub); + }); + test('it exists', function (assert) { let route = this.owner.lookup('route:page-not-found'); assert.ok(route); From 7cfc531f3b23eed480beb2bf8dfd16cb9e9e7935 Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Thu, 19 Feb 2026 13:31:44 +0530 Subject: [PATCH 4/4] fix: replace window.location with ember's router --- app/services/login.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/login.js b/app/services/login.js index 60c84dd4..e868c45e 100644 --- a/app/services/login.js +++ b/app/services/login.js @@ -1,6 +1,6 @@ import Service, { service } from '@ember/service'; import { tracked } from '@glimmer/tracking'; -import { APPS, AUTH } from '../constants/urls'; +import { APPS } from '../constants/urls'; export default class LoginService extends Service { @service store; @@ -9,6 +9,7 @@ export default class LoginService extends Service { @tracked isLoading = true; @service fastboot; @service featureFlag; + @service router; HeadersToCopy = ['Host', 'Cookie', 'User-Agent']; @@ -34,10 +35,9 @@ export default class LoginService extends Service { if ( user.incompleteUserDetails && !this.featureFlag.isDevMode && - !this.fastboot.isFastBoot && - window.location.pathname !== '/new-signup' + this.router.currentRoute?.name !== 'new-signup' ) { - window.location.replace(AUTH.SIGN_UP); + this.router.replaceWith('/new-signup'); } this.isLoggedIn = true; this.userData = user;