TSphinxConfig.OnGenerateEmailConfirmationToken event not triggered

I have set TSphinxConfig.RequireConfirmedEmail := true and implemented the TSphinxConfig.OnGenerateEmailConfirmationToken event handler.

This all worked OK until I started adding the use of User Name (in addition to Email Address). Now the event is no longer triggered (confirmed by debugging) and I can't figure out why?

Any suggestions as to why this doesn't work? Could it be related to email and user name combination?

Are you able to reproduce the issue in the existing Sphinx demo?

Were the e-mail filled? If the e-mail is blank, no confirmation will be sent.

If possible please send steps to reproduce the issue with Sphinx demo.

Will try to do so.

However can you confirm that my assumption is correct that if I create a user with EmailConfirmed = false and TSphinxConfig.RequireConfirmedEmail = true, OnGenerateEmailConfirmationToken should fire?

Yes, it should fire when user is trying to login.

I am embarrassed to tell you but I was expecting the event to trigger when the user was created (now via a procedure in the Sphinx server, so to say). :face_with_peeking_eye: Obviously, it makes more sense to create & send the confirmation token on first log in.

In that context (adding users from the back office, so to speak) I seem to be missing a couple of properties/features:

  1. TSphinxConfig.UserOptions.RequireUniqueUserName
  2. TSphinxConfig.RequirePasswordChangeOnFirstLogin
  3. Combined with 2. above, a possibility to somehow retrieve the user password so it can be sent with the email confirmation token. I.e. confirm email and then force password change.

Are these planned for the near future or should I raise a feature request / implement something myself?

User names are always required to be unique no matter what.

Please check: