File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ export const getAxiosConfig = (): AxiosConfig => {
4545 * Processes authentication errors and returns a user-friendly error message
4646 */
4747export const processAuthError = ( error : AxiosError < any > , jwtAuthEnabled = false ) : string => {
48- let errorMessage = `Failed to authorize user: ${ error . response ?. data ?. trim ( ) ?? '' } . ` ;
48+ const errorMessage = ( error . response ?. data as any ) ?. message ?? 'Unknown error' ;
49+ let msg = `Failed to authorize user: ${ errorMessage . trim ( ) } . ` ;
4950 if ( jwtAuthEnabled && ! localStorage . getItem ( 'ui_jwt_token' ) ) {
50- errorMessage +=
51- 'Set your JWT token in the settings page or disable JWT auth in your app configuration.' ;
51+ msg += 'Set your JWT token in the settings page or disable JWT auth in your app configuration.' ;
5252 } else {
53- errorMessage += 'Check your JWT token or disable JWT auth in your app configuration.' ;
53+ msg += 'Check your JWT token or disable JWT auth in your app configuration.' ;
5454 }
55- return errorMessage ;
55+ return msg ;
5656} ;
You can’t perform that action at this time.
0 commit comments