fix: Error message on Login not shown #1508
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
|
The code looks good overall, but there are a few areas where improvements can be made:
Here are the suggested changes: // 1. Improved error handling
try {
// ...
} catch (error) {
let errorFeedback;
if (error instanceof SomeSpecificError) {
errorFeedback = "Specific error message";
} else if (error.code === 'some_error_code') {
errorFeedback = "Another specific error message";
} else {
errorFeedback = error.message;
}
setSignInError(errorFeedback);
} finally {
setLoggingIn(false);
}
// 2. Add error to useEffect dependencies
useEffect(() => {
if (error) {
setSignInError(error);
}
}, [error]);
// 3. Remove showLogin state
// Replace all instances of showLogin with !totpLogin && !totpBackupPlease consider these suggestions and apply them if they make sense in your context. |
* main: (28 commits) chore: Add Table of Contents to README (formbricks#1427) fix: account deletion failing issue (formbricks#1509) fix: remove welcome card from email preview (formbricks#1495) fix(bug): default role implemented (formbricks#1524) fix: changing description of Code Action (formbricks#1522) refactor: Migrate activity service (formbricks#1471) fix: Error in Docs navigation formbricks#1518 (formbricks#1521) feat: dynamic title and description (formbricks#1459) fix: Spelling Errors (formbricks#1517) fix: added scrollbar whenever overflowed in the settings/profile page (formbricks#1498) fix: long url not getting reset after closing modal (formbricks#1502) fix: Unexpected Behavior when Toggling Italics in Text Editor and improve clarity of formatting status (formbricks#1506) fix: zod pin validation failing (formbricks#1507) fix: Error message on Login not shown (formbricks#1508) fix: downgrade nextjs to fix error with react email (formbricks#1516) chore: downgrade next version in formbricks-com (formbricks#1513) feat: picture selection question (formbricks#1388) feat: formtribe leaderboard update as per today (formbricks#1505) fix: Added if statement for preventing use of reserved word in question ID (formbricks#1435) fix: Disabling Welcome Card leads buggy preview (formbricks#1320) ...
What does this PR do?
Fixes FOR-1461
Type of change
How should this be tested?
Create a formbricks account without using any provider (for example [email protected])
Now try to login using same email but this time using a provider(for example lets say google)
Checklist
Required
pnpm buildconsole.logsgit pull origin mainAppreciated