Sign-in directly when a user uses the sign-up page with valid credentials

When a registered user tries to sign in using the sign up screen a custom error message is displayed.

We would like instead to have that user be signed in, if the email and password are correct.

Thanks.

Hi Lisa,

Thanks for the code example.

What I don’t understand is how to make this work with the Universal login pages.
How/where can this logic be integrated?

Thank you.