Hi @kkrp1,
- I would recommend using
event.connection.strategy instead of event.user.identities as identities is an array, and in the event of a user with linked accounts, this may pose a problem. It will look something like this in your action:
if (event.connection.strategy === "google-oauth2" || "apple" || "github") {
api.access.deny("Social login not allowed.");
}
Please see all of the available event.connection.strategy values: [ad , adfs , amazon , apple , dropbox , bitbucket , aol , auth0-oidc , auth0 , baidu , bitly , box , custom , daccount , dwolla , email , evernote-sandbox , evernote , exact , facebook , fitbit , flickr , github , google-apps , google-oauth2 , instagram , ip , line , linkedin , miicard , oauth1 , oauth2 , office365 , oidc , okta , paypal , paypal-sandbox , pingfederate , planningcenter , renren , salesforce-community , salesforce-sandbox , salesforce , samlp , sharepoint , shopify , sms , soundcloud , thecity-sandbox , thecity , thirtysevensignals , twitter , untappd , vkontakte , waad , weibo , windowslive , wordpress , yahoo , yammer , yandex ]
- I did some testing with an action blocking google social connection logins and while I was denied access, a user was still created in Auth0.
Please let me know if you have any additional questions!
Best,
Mary Beth