Version 4 Authentication

I’m upgrading my app from V3 to V4. I have an issue with authentication.

All user personal data including email addresses are encrypted on the database.

On V3 at login I allow the user to input either a username or an email address into the username field. In the Users controller if the username field looks like an email address I go find the username from the email address and backfill the username field into the request, then let auth log him in.

In V4 the authentication is done before the controller gets to run. Can anyone suggest a way to get the same functionality to work on V4 please?

You were doing this in your login function? Just do it in a bit of middleware instead, which you load before the authentication middleware? Or write a custom authenticator?

Thanks for your response. I guess a custom authenticator might do it, any idea how I load that?

Sorry, it’s maybe actually a custom resolver that you want?

Hey thanks Zuluru, that has done it. My new custom resolver does exactly what I want. Thanks again.
Happy New Year!

1 Like