jhipster / generator-jhipster-micronaut

Micronaut blueprint for JHipster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DatabaseAuthenticationProvider is using EmailValidator to determine if input is an email

JasonTypesCodes opened this issue · comments

DatabaseAuthenticationProvider is using EmailValidator to determine if input is an email and then based on the result determines how to query the database.

We don't have a context or annotation metadata to pass to the validator and are currently passing a null. We were lucky in that an older implementation of the class wasn't using that. The newer implementation does and this is holding us back from upgrading to Micronaut 2.5 and further.

My suggestion is to use an or condition in the DB query to check for username or email. That should yield the same results and doesn't make this implementation dependent on the EmailValidator class.

Should be merged into #259, along with #268 if that one is fixed as well. That should fix the whole user registration workflow issue.