Rule: determine if user logged-in with email or username

Would it be possible in a rule to determine whether a user logged in with their email or with username, like from context object? Currently both would result in a successful log-in but it is unclear how to retrieve if user had used his/her email or username.

Just tested and it seems that the username (and also password) are stripped from the request object in context. Checking internally why that is. For the password, I’m sure it’s for security purposes, but not sure about username/email.

Interested on the use case: what would you do with this kind of information, whether he user username or email?

1 Like

@ mathiasconradt
Thanks for checking this out, I understand that the credentials are stripped from the context object for security reasons but it would be great if a parameter would be available indicating if user logged-in by username or by e-mail

What’s the use case around it? Why would you need to know it?
I guess a check for an email pattern vs. non-email pattern isn’t sufficient (of course if users can also enter an email address as username, it’s not reliable)?