From ea08cb393596df6e87da3238de62d18702741c63 Mon Sep 17 00:00:00 2001 From: Sagar Bakhtar Date: Sat, 1 Jun 2019 13:13:09 +0530 Subject: [PATCH] Better function name --- packages/ra-core/src/sideEffect/auth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ra-core/src/sideEffect/auth.ts b/packages/ra-core/src/sideEffect/auth.ts index c8b985f8109..452caac01bc 100644 --- a/packages/ra-core/src/sideEffect/auth.ts +++ b/packages/ra-core/src/sideEffect/auth.ts @@ -29,7 +29,7 @@ const nextPathnameSelector = state => { }; const currentPathnameSelector = state => state.router.location; -const errorMessageSelector = (error, defaultMessage) => +const getErrorMessage = (error, defaultMessage) => typeof error === 'string' ? error : typeof error === 'undefined' || !error.message @@ -64,7 +64,7 @@ export default (authProvider?: AuthProvider) => { error: e, meta: { auth: true }, }); - const errorMessage = errorMessageSelector( + const errorMessage = getErrorMessage( e, 'ra.auth.sign_in_error' ); @@ -83,7 +83,7 @@ export default (authProvider?: AuthProvider) => { state: { nextPathname: meta.pathName }, }) ); - const errorMessage = errorMessageSelector( + const errorMessage = getErrorMessage( error, 'ra.auth.auth_check_error' );