File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
apps/web/src/routes/(app)/login Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 14
14
15
15
let error = $state <string >();
16
16
let errorCode = $state <string >();
17
+ let confirmationSent = $state <boolean >(false );
17
18
18
19
const isFormValid = $derived (!! email && !! password );
19
20
50
51
if (response .type === ' error' ) {
51
52
error = response .errorMessage ;
52
53
errorCode = response .errorCode ;
54
+ confirmationSent = false ;
53
55
console .error (' Failed to resend confirmation email:' , response .raw ?? response .errorMessage );
54
56
} else {
55
- error = ' Confirmation email resent. Please check your inbox.' ;
57
+ error = undefined ;
58
+ errorCode = undefined ;
59
+ confirmationSent = true ;
60
+ // Clear the confirmation message after 5 seconds
61
+ setTimeout (() => {
62
+ confirmationSent = false ;
63
+ }, 5000 );
56
64
}
57
65
}
58
66
</script >
89
97
90
98
<Button type ="submit" style ="pop" disabled ={! isFormValid }>Log in</Button >
91
99
92
- {#if error }
100
+ {#if confirmationSent }
101
+ <InfoMessage filled outlined ={false } style =" success" class =" m-top-16" >
102
+ {#snippet content ()}
103
+ <p >Confirmation email sent! Please check your inbox.</p >
104
+ {/ snippet }
105
+ </InfoMessage >
106
+ {:else if error }
93
107
<InfoMessage filled outlined ={false } style =" error" class =" m-top-16" >
94
108
{#snippet content ()}
95
109
{#if errorCode === ' email_not_verified' }
You can’t perform that action at this time.
0 commit comments