How to determine the identifier used to log in?

Hello!
We are using a database connection and allowing users to log in with either an email or a phone number. We want to implement login logic that depends on which identifier was used—phone number or email.

Would you mind helping us find a way to determine which identifier was used to log in?

P.S. I thought this information would be contained in the event object in the post-login trigger, but I couldn’t find it.

Hi @artem_romanov

Welcome to the Auth0 Community!

I’ve tested a user’s login with both username and email, upon checking the Management API’s Get User by ID, I’ve found that Identifier will return the type an value used on each login, which is found under the details object.

You should be able to invoke the Management API within Actions; for additional steps on how to perform this, please take a look at our Knowledge Article.

Let me know if this is what you were looking for.

Have a great one!
Gerald

Thanks for your reply!
If I get right, your suggestion is to get log messages via Management API which you have shared with me, and check details.identifier field.
The API you provided returning the list of log records with the different types. But details.identifier exists only in logs with the ‘s’ type. Please correct me if I am wrong. Thanks for your suggestion, but we don’t want base our business logic on log records analysis.
If would be perfect to have login type info somewhere in the event object.