play-authenticate
play-authenticate copied to clipboard
No verification email sent
In our application, we create the accounts internally, and then we send out the verification e-mails for those accounts at a later point in time.
The problem occurs when one of those users attempts to log in to the site before the verification e-mail has been sent, or before they've actually verified their account. In that case, it incorrectly tells them that a verification e-mail has been sent.
I believe the problem is in UsernamePasswordAuthProvider.authenticate() when the payload == Case.LOGIN, and the LoginResult is USER_UNVERIFIED. It looks like it returns userUnverified() without calling sendVerifyEmailMailing() first.
It appears that I can work around this be calling:
sendVerifyEmailMailingAfterSignup(u, Context.current());
in my loginUser() implementation before returning LoginResult.USER_UNVERIFIED.