I’m trying to call my backend API once to create a user when they have signed up. I created a rule that checks for loginCount === 1 as advised. The problem is, when using the React sample here the rule always gets called twice. In the logs, I do indeed see “Success Signup” followed by “Success Login”. In both cases, loginCount is 1 and the context is identical.
Needless to say, my servers throws an error at the second call. Any ideas how to prevent the second one from calling my server? In fact, why isn’t loginCount equal to 0 on “Success Signup”?
Hello @picosam The user is actually logged in when they sign up, which is why you are seeing loginCount === 1. I would suggest adding your own attribute to app_metadata to act as a flag. Your rule checks and sets the flag attribute: