Hi there,
Context:
On our website, we only allow users to register with a professional (work) email. To enforce this, we use the Pre User Registration
trigger, which works perfectly for registrations that require a password.
Once the user submits a password as part of the registration flow, we rely on the Post Login
trigger to render an Auth0 form that collects additional information to complete the registration process.
What we’re trying to achieve:
We want to implement social sign-in/registration using LinkedIn. However, we’ve noticed that when a user registers via LinkedIn, the Pre User Registration
trigger is skipped. Instead, the user proceeds directly to the Post Login
trigger and sees our additional-info form as expected. When they submit that form with a non-work email, our system correctly blocks the registration and displays an error message—this part is behaving as intended.
The problem:
If a user navigates away from our platform and then returns or refreshes the page, they remain logged in to Auth0 and are immediately shown the registration form again. Because they don’t have a work email, they cannot complete the form, which traps them in an infinite loop.
Our question:
Is there a way using Auth0 Flows to log a user out of Auth0 if they don’t meet the work-email requirement during a social sign-in? In other words, we’d like to force a logout (or prevent the user from remaining authenticated) so that they aren’t stuck on that “complete your registration” form indefinitely.
Thanks in advance for any guidance!