When I signup via Facebook, the login flow is called and my token is enriched with the relevant data. However, after 2-4 days, the token suddenly no longer has the custom claims. The only thing that helps then is to delete the account so that the user has to register again.
exports.onExecutePostLogin = async (event, api) => {
api.accessToken.setCustomClaim('xxx_email', event.user.user_metadata.email);
api.accessToken.setCustomClaim('xxx_given_name', event.user.user_metadata.given_name);
api.accessToken.setCustomClaim('xxx_family_name', event.user.user_metadata.family_name);
};
makes no difference in using onContinueLogin or onExecutePostLogin.
can anyone confirm or show me, how can I reliable add custom claims to the token?