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 = () => {
5050 duration : 20_000 , // 20 seconds
5151 } ) ;
5252 } 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+ }
5477 } finally {
5578 setIsLoading ( false ) ;
5679 }
You can’t perform that action at this time.
0 commit comments