Sync user each login with using custom social

Hey guys, hi girls.

I’m wondering is it possible to force user synchronization each login? I use Discord for logging in to my app. Discord has some kind of “roles” on a server. I.e. if your role is “white” or you have no role, you have very restricted possibilities, but If you have uhm… yellow role, your privileges are greater. You may google “Discord permissions calculator” and check how it works. But anyway - If user is already signed in to my app and his role will be changed, that’s not going to be changed in Auth0 database. I can see that you can force sync for prepared by Auth0 socials, i.e. Google or Facebook but honestly I can’t find this option for custom socials. The only way for me for now is manually remove user from database and ask him to log in again, but that’s not how it should work, isn’t it?

1 Like

Hello! Welcome to our Community!

In order to achieve what you are looking for (sync users and their changes with Auth0) you will need to modify the script on your custom Social Connection.

You can customize your script to be able to update those changes from your custom Social connection > Settings > Fetch User Profile Script.

I hope this helps to solve your queries.

Thanks!

2 Likes

Hey Karin, thank you! :slight_smile:

Problem is already solved - there was a small mistake in my code also in this script which are you talking about and in “rules” bookmark, where I had custom claims.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.