Skip to content

Commit

Permalink
chore(ui): Add global errors to signin steps (#3746)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcarpenter authored Jul 18, 2024
1 parent aa0efec commit d6cf9a3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changeset/happy-pants-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
27 changes: 27 additions & 0 deletions packages/ui/src/components/sign-in/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ export function SignInComponentLoaded() {
</Card.Header>

<Card.Body>
<Common.GlobalError>
{({ message }) => {
return <Alert>{message}</Alert>;
}}
</Common.GlobalError>

<Connections disabled={isGlobalLoading} />

{hasConnection && hasIdentifier ? <Seperator>{t('dividerText')}</Seperator> : null}
Expand Down Expand Up @@ -223,6 +229,12 @@ export function SignInComponentLoaded() {
</Card.Description>
</Card.Header>
<Card.Body>
<Common.GlobalError>
{({ message }) => {
return <Alert>{message}</Alert>;
}}
</Common.GlobalError>

<PasswordField
alternativeFieldTrigger={
isPasswordResetSupported ? (
Expand Down Expand Up @@ -485,6 +497,11 @@ export function SignInComponentLoaded() {
<Card.Description>{t('signIn.alternativeMethods.subtitle')}</Card.Description>
</Card.Header>
<Card.Body>
<Common.GlobalError>
{({ message }) => {
return <Alert>{message}</Alert>;
}}
</Common.GlobalError>
<div className='flex flex-col gap-2'>
<Connections disabled={isGlobalLoading} />

Expand Down Expand Up @@ -551,6 +568,11 @@ export function SignInComponentLoaded() {
<Card.Title>{t('signIn.forgotPasswordAlternativeMethods.title')}</Card.Title>
</Card.Header>
<Card.Body>
<Common.GlobalError>
{({ message }) => {
return <Alert>{message}</Alert>;
}}
</Common.GlobalError>
<div className='flex flex-col justify-center gap-4'>
<SignIn.SupportedStrategy
name='reset_password_email_code'
Expand Down Expand Up @@ -631,6 +653,11 @@ export function SignInComponentLoaded() {
<Card.Title>{t('signIn.resetPassword.title')}</Card.Title>
</Card.Header>
<Card.Body>
<Common.GlobalError>
{({ message }) => {
return <Alert>{message}</Alert>;
}}
</Common.GlobalError>
<div className='flex flex-col justify-center gap-4'>
<PasswordField
name='password'
Expand Down

0 comments on commit d6cf9a3

Please sign in to comment.