-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Surface all auth errors during login
This PR patches the following issue: 1. Sign up with Github with user A 2. Sign out 3. Try to sign in with the email of user A 4. The API returns a 400 error not displayed in the Login form. After this PR, all server auth errors will be displayed in the UI. It also contains some minor copywriting fixes and clean-ups.
- Loading branch information
1 parent
5b7a721
commit 5741bf4
Showing
5 changed files
with
153 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { IResponseError } from '@novu/shared'; | ||
|
||
export function parseServerErrorMessage(error: IResponseError | null): String { | ||
if (!error) { | ||
return ''; | ||
} | ||
|
||
return Array.isArray(error?.message) ? error?.message[0] : error?.message; | ||
} |