Skip to content

Commit 56b3de5

Browse files
committed
fix social login tests
1 parent 05eabf9 commit 56b3de5

File tree

1 file changed

+3
-2
lines changed
  • packages/template-retail-react-app/app/components/social-login

1 file changed

+3
-2
lines changed

packages/template-retail-react-app/app/components/social-login/index.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const IDP_CONFIG = {
4242
* @param {array} idps - array of known IDPs to show buttons for
4343
* @returns
4444
*/
45-
const SocialLogin = ({form, idps}) => {
45+
const SocialLogin = ({form, idps = []}) => {
4646
const {formatMessage} = useIntl()
4747
const authorizeIDP = useAuthHelper(AuthHelpers.AuthorizeIDP)
4848

@@ -52,7 +52,8 @@ const SocialLogin = ({form, idps}) => {
5252
const redirectURI = buildRedirectURI(appOrigin, redirectPath)
5353

5454
const isIdpValid = (name) => {
55-
return name in IDP_CONFIG && IDP_CONFIG[name.toLowerCase()]
55+
const idp = name.toLowerCase()
56+
return idp in IDP_CONFIG && IDP_CONFIG[idp]
5657
}
5758

5859
useEffect(() => {

0 commit comments

Comments
 (0)