I am trying to redirect users to a “Create Profile” page after their sign up. I have created a rule that checks the login count through following rule.
Now this does redirect properly, but after sign up the page keeps reloading for reasons I can’t think of.
Is there something wrong with the rule that I have created?
I would guess that this redirect rule is being run again, which could cause some issues. Using a flag on the user’s app_metadata may be better than login count.
So, I am updating the user_metadata with a field “createdProfile: true” and using this rule to redirect to another page if the profile on my database is already created and I am still facing the same issue. (page keeps reloading)
It sounds like you are redirecting from this rule and never resuming the rules flow.
Context.redirect allows you to redirect mid-authentication, and expects you to redirect back after collecting whatever information, and resume the auth flow.
Are you redirecting and never resuming authentication?
The redirect that occurs after authentication is determined by the redirect_uri that is sent during the initial request (from your application).
Many of our customers choose to do a redirect within a rule, just like you are doing, to collect this type of information. The advantage of using a rule is the fact that your can require the information is received before granting access, making the process mandatory. All you have to do is resume authentication after the fact. The first doc I linked lays out how to resume authentication.