From aa59acf0bca994fdad0904a5b2d773ae7367c7cc Mon Sep 17 00:00:00 2001 From: Zainab Amir Date: Thu, 12 Jan 2023 18:32:52 +0500 Subject: [PATCH] fix: sso button not appearing on login page (#733) --- src/common-components/data/reducers.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common-components/data/reducers.js b/src/common-components/data/reducers.js index 3855a07f..58c1f971 100644 --- a/src/common-components/data/reducers.js +++ b/src/common-components/data/reducers.js @@ -25,7 +25,11 @@ const reducer = (state = defaultState, action) => { }; case THIRD_PARTY_AUTH_CONTEXT.SUCCESS: { const extendedProfile = action.payload.optionalFields.extended_profile; - const extendedProfileArray = Object.keys(extendedProfile).length !== 0 ? extendedProfile : []; + let extendedProfileArray = []; + if (extendedProfile && Object.keys(extendedProfile).length !== 0) { + extendedProfileArray = extendedProfile; + } + return { ...state, extendedProfile: extendedProfileArray,