File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
web/src/modules/auth/components/client Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,30 @@ export const LoginForm: FC = () => {
50
50
duration : 20_000 , // 20 seconds
51
51
} ) ;
52
52
} catch ( error ) {
53
- toast . error ( 'An error occurred. Please try again later.' ) ;
53
+ if ( ( error as any ) . isAxiosError ) {
54
+ const axiosError = error as any ;
55
+
56
+ if ( axiosError . response ) {
57
+ const { status } = axiosError . response ;
58
+
59
+ if ( status === 429 ) {
60
+ toast . error ( 'Too many requests. Please try again later.' , {
61
+ position : 'top-center' ,
62
+ duration : 20_000 , // 20 seconds
63
+ } ) ;
64
+ } else {
65
+ toast . error ( 'An unexpected error occurred' , {
66
+ position : 'top-center' ,
67
+ duration : 20_000 , // 20 seconds
68
+ } ) ;
69
+ }
70
+ }
71
+ } else {
72
+ toast . error ( 'An unexpected error occurred' , {
73
+ position : 'top-center' ,
74
+ duration : 20_000 , // 20 seconds
75
+ } ) ;
76
+ }
54
77
} finally {
55
78
setIsLoading ( false ) ;
56
79
}
You can’t perform that action at this time.
0 commit comments