Change signup success condition to response status#609
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 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. ChangesSignup Success Navigation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🎉 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
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 Createdstatus code is more reliable and aligns with REST API conventions.Testing
Summary by CodeRabbit