From Rule know if user is logging in or creating new account (universal login)

We are using Universal Login and are setting up a rule where we’d like to know if the user used a login page or a sign-up page. Yes, we understand we can determine if it is the user’s first login using context.stats.loginsCount, though we also like to know where the user came from. Is this their first login from the login page (probably using some third party oAuth) or their first login from the sign-up page.

If there isn’t a way currently, perhaps something could be added to the form or query string which we could read?

Thank you.

Hey @brett2!

If possible, I recommend using an Action as opposed to a rule - From within an Action you should be able to utilize the event.stats.loginsCount together with either the event.authentication.name or event.connection data to know where a user is coming from.

Hope this helps!

Hey thank you @tyf. Though I don’t think this will let me know which page they came from being sign-in or signup, and this distinction is important, what I am looking for. Which connection they are using isn’t really needed.

My goal is to determine their intention when they logged in, where they trying to login, or were actually wanting to create a new account. Auth0 doesn’t handle this distinction and it causes our users a mass amount of confusion and us a lot of clean up. So I am trying to think of different ways of know what the user was intending as they were logging in and then perhaps I can do something with that information, like not allow them to login if they came through the signin page and this is their 1st login ever.

No problem, happy to help where I can! You might also want to look into using a Post Registration Action. This only applies to users registering at Auth0, not a social connection.

Upon sign up using universal login, there will also be a login event. Given this, if the user just signed up the event.stats.loginsCount will equal 1. My thinking is that if you know the login count is 1 and the connection name is X, then you know the user came from sign up (connection auth0) or social login (google, facebook, etc.). If the login count is greater than 1 then you know it’s solely a login.

Thanks @tyf. The hole I see with that is I will not know if the user did use the signup page and is coming from a social account (which is the only way I wish social accounts can sign up using Auth0). I guess I will need to think on this a bit more