File tree Expand file tree Collapse file tree 3 files changed +7
-15
lines changed Expand file tree Collapse file tree 3 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ function App() {
69
69
< Route index element = { < Navigate to = "/auth/login" /> } />
70
70
< Route path = "signup" element = { < SignUp /> } />
71
71
< Route path = "login" element = { < LogIn /> } />
72
- < Route
73
- path = "verifyEmail/:userId?"
74
- element = { < EmailVerification /> }
75
- / >
72
+ < Route path = "verify-email" >
73
+ < Route index element = { < EmailVerification /> } />
74
+ < Route path = ":userId" element = { < EmailVerification /> } />
75
+ </ Route >
76
76
< Route path = "forget-password" element = { < ForgetPassword /> } />
77
77
< Route path = "*" element = { < Navigate to = "/auth/login" /> } />
78
78
</ Route >
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ const AuthProvider: React.FC<{ children?: React.ReactNode }> = (props) => {
66
66
} )
67
67
. then ( ( ) => userClient . post ( "users/send-verification-email" , { email } ) )
68
68
. then ( ( res ) => {
69
- navigate ( `/auth/verifyEmail /${ res . data . data . id } ` ) ;
69
+ navigate ( `/auth/verify-email /${ res . data . data . id } ` ) ;
70
70
} )
71
71
. catch ( ( err ) => {
72
72
setUser ( null ) ;
@@ -88,7 +88,7 @@ const AuthProvider: React.FC<{ children?: React.ReactNode }> = (props) => {
88
88
} )
89
89
. catch ( ( err ) => {
90
90
if ( err . response ?. data . message === "User not verified." ) {
91
- navigate ( `/auth/verifyEmail ` ) ;
91
+ navigate ( `/auth/verify-email ` ) ;
92
92
}
93
93
setUser ( null ) ;
94
94
toast . error ( err . response ?. data . message || err . message ) ;
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ const EmailVerification: React.FC = () => {
77
77
onChange = { ( e ) => setEmail ( e . target . value ) }
78
78
slotProps = { {
79
79
input : {
80
- endAdornment : < Button onClick = { handleSendEmail } > Send </ Button > ,
80
+ endAdornment : < Button onClick = { handleSendEmail } > Resend </ Button > ,
81
81
} ,
82
82
} }
83
83
/>
@@ -93,14 +93,6 @@ const EmailVerification: React.FC = () => {
93
93
spacing = { 2 }
94
94
sx = { ( theme ) => ( { marginTop : theme . spacing ( 4 ) } ) }
95
95
>
96
- < Button
97
- fullWidth
98
- variant = "contained"
99
- color = "secondary"
100
- onClick = { handleSendEmail }
101
- >
102
- Resend
103
- </ Button >
104
96
< Button fullWidth variant = "contained" onClick = { handleVerifyAcc } >
105
97
Verify
106
98
</ Button >
You can’t perform that action at this time.
0 commit comments