Skip to content

Commit fe6215d

Browse files
authored
fix(clerk-js): Pass the whole error object into card.setError (#2957)
The card.setError internally parses localizations for the provided error code.
1 parent 5db6dbb commit fe6215d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/popular-monkeys-clap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Fix the OAuth errors coming from the server to use localizations

packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export function _SignInStart(): JSX.Element {
175175
case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:
176176
case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:
177177
case ERROR_CODES.USER_LOCKED:
178-
card.setError(error.longMessage);
178+
card.setError(error);
179179
break;
180180
default:
181181
// Error from server may be too much information for the end user, so set a generic error

packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function _SignUpStart(): JSX.Element {
153153
case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:
154154
case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:
155155
case ERROR_CODES.USER_LOCKED:
156-
card.setError(error.longMessage);
156+
card.setError(error);
157157
break;
158158
default:
159159
// Error from server may be too much information for the end user, so set a generic error

0 commit comments

Comments
 (0)