Skip to content

Change signup success condition to response status#609

Open
Vinuthnainti wants to merge 1 commit into
GitMetricsLab:mainfrom
Vinuthnainti:patch-2
Open

Change signup success condition to response status#609
Vinuthnainti wants to merge 1 commit into
GitMetricsLab:mainfrom
Vinuthnainti:patch-2

Conversation

@Vinuthnainti
Copy link
Copy Markdown

@Vinuthnainti Vinuthnainti commented May 29, 2026

Description

This PR improves signup success handling by replacing response message string comparison with an HTTP status code check.

Changes

Replaced:

if (response.data.message === "User created successfully") {
navigate("/login");
}
with:
if (response.status === 201) {
navigate("/login");
}

The previous implementation depended on an exact backend response message. If the message text changes in the future, successful signup could fail to redirect users to the login page.

Using the HTTP 201 Created status code is more reliable and aligns with REST API conventions.

Testing

  • Verified successful signup redirects users to the login page.
  • Confirmed existing signup functionality continues to work as expected.

Summary by CodeRabbit

  • Bug Fixes
    • Improved signup form reliability by enhancing account creation success detection, ensuring users are consistently redirected after completing registration.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 203478e
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a19b640aa7d9d0008db103e
😎 Deploy Preview https://deploy-preview-609--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e07a9ab-5df7-4d44-9e72-905c6d79603b

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae0ef6 and 203478e.

📒 Files selected for processing (1)
  • src/pages/Signup/Signup.tsx

📝 Walkthrough

Walkthrough

The signup form's post-submission success handler now checks the HTTP response status code (201) to decide whether to redirect to login, instead of relying on a specific backend message string for this decision.

Changes

Signup Success Navigation

Layer / File(s) Summary
HTTP status-based success condition
src/pages/Signup/Signup.tsx
handleSubmit gates the redirect to /login on response.status === 201 instead of comparing response.data.message to a hardcoded success string.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

level:intermediate, quality:clean

Poem

A rabbit hops with joy so keen,
Status codes now rule the scene,
No more strings to chase around,
HTTP 201—success is found! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing the signup success condition from a response message comparison to an HTTP status code check.
Description check ✅ Passed The description is mostly complete with clear explanation of changes, rationale, and testing, though it deviates from the template format by omitting related issue reference and type of change checkbox.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🎉 Thank you @Vinuthnainti for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant