Skip to content

Conversation

@MayankBansal12
Copy link
Member

Date: 15-01-26

Developer Name: @MayankBansal12


Issue Ticket Number:-

Description:

  • Adds extra check to avoid redirect if user is already on /new-signup
  • Fixes HOME variable in development environment to use dev.realdevsquad.com

Is Under Feature Flag

  • Yes
  • No

Database changes

  • Yes
  • No

Breaking changes (If your feature is breaking/missing something please mention pending tickets)

  • Yes
  • No

Is Development Tested?

  • Yes
  • No

Tested in staging?

  • Yes
  • No

Add relevant Screenshot below ( e.g test coverage etc. )

screencast
Screencast.from.2026-01-15.02-31-37.mp4

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

Modified the development HOME URL from a root path to a subdomain-based configuration using existing environment variables, and augmented LoginService redirect logic to prevent redirects when users are on the '/new-signup' path, allowing them to complete signup without being redirected away.

Changes

Cohort / File(s) Summary
URL Configuration
app/constants/urls.js
Updated development HOME URL from '/' to subdomain-based URL leveraging SCHEME and DOMAIN constants
Login Service Redirect Logic
app/services/login.js
Added conditional guard to suppress redirect to sign-up page when current path is '/new-signup', preserving user flow on that route

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • RealDevSquad/website-www#1115: Removes dev-gating and beforeModel redirect from '/new-signup' route, working in tandem with this PR's LoginService redirect suppression logic.

Suggested reviewers

  • Hariom01010
  • iamitprakash

Poem

🐰 A signup path, once prone to stray,
Now anchors users where they stay,
With HOME reborn through domains new,
The journey flows the proper way through! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fix: new infinite signup redirect for staging and development' partially addresses the actual changes. While the PR does fix signup redirect logic and modifies URLs for development/staging, the word 'infinite' in the title is misleading—the PR fixes an infinite redirect issue rather than creating one, making the title ambiguous. Revise the title to accurately reflect the fix, such as 'fix: prevent infinite signup redirect on /new-signup page' or 'fix: correct redirect logic and dev environment HOME URL' to clearly convey the issue being resolved.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is well-detailed and directly related to the changeset, explaining both modifications and their rationale.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@app/services/login.js`:
- Around line 35-43: The code reads window.location.pathname and calls
window.location.replace() unguarded; wrap those accesses with the FastBoot guard
already injected on the service by checking this.fastboot.isFastBoot (or its
negation) before touching window. Concretely, only compute currentPath from
window.location.pathname and call window.location.replace(AUTH.SIGN_UP) when
this.fastboot.isFastBoot is false (and keep the existing conditions
user.incompleteUserDetails and !this.featureFlag.isDevMode); alternatively wrap
the entire redirect block (the currentPath variable, the conditional using
featureFlag.isDevMode, and the call to window.location.replace) in a
not-FastBoot check so server-side rendering won’t access window.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 126fd13 and 3004514.

📒 Files selected for processing (2)
  • app/constants/urls.js
  • app/services/login.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (18.x)
🔇 Additional comments (1)
app/constants/urls.js (1)

36-36: LGTM, but note the mixed URL pattern in development config.

The change to use https://dev.realdevsquad.com for HOME aligns with the PR objective. This ensures AUTH.SIGN_UP resolves to a full URL, which is necessary for window.location.replace() to work correctly in the login service.

However, note that other development URLs (GOTO, EVENTS, PROFILE, IDENTITY, MY_STATUS) remain as relative paths while HOME is now absolute. This inconsistency is acceptable if intentional, but consider documenting this pattern or aligning all URLs for consistency in a future refactor.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@MayankBansal12 MayankBansal12 changed the title fix: new signup redirect for staging and development fix: new infinite signup redirect for staging and development Jan 15, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 15, 2026

Deploying www-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8ffe062
Status: ✅  Deploy successful!
Preview URL: https://628a7e32.www-rds.pages.dev
Branch Preview URL: https://fix-login-redirect.www-rds.pages.dev

View logs

import { setupTest } from 'website-www/tests/helpers';
import { visit } from '@ember/test-helpers';
import Service from '@ember/service';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this login stub is required to prevent flaky behaviour for tests with login redirect and from browser timeout issues

user.incompleteUserDetails &&
!this.featureFlag.isDevMode &&
!this.fastboot.isFastBoot &&
window.location.pathname !== '/new-signup'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the logic behind this change?

Copy link
Member Author

@MayankBansal12 MayankBansal12 Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stopping redirection if user is already on new-signup route
(it was earlier causing infinite redirection loop on new signup page for new users)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for the loop?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for the loop?

issue #1132
I am facing the same thing

Comment on lines +34 to +41
if (
user.incompleteUserDetails &&
!this.featureFlag.isDevMode &&
!this.fastboot.isFastBoot &&
window.location.pathname !== '/new-signup'
) {
window.location.replace(AUTH.SIGN_UP);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question, why is the window.location being used for route transition?

Why not use ember router service?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants