Skip to content

Users unable to trigger account confirmation email if initial email expires #19177

Description

@rwawr

Describe the bug

If the "Users must verify their email address" setting under Security > Settings > User Registration is enabled, newly registered users will be created with the EmailConfirmed flag set to false, as expected. If a user allows the confirmation link in the initial email to expire, they have no way to request that a new confirmation email be sent aside from having an administrator resend the confirmation email from the admin panel. This is perhaps not strictly a bug but is certainly undesirable UX. An unverified user who attempts to sign in will see a notification stating "You must confirm your email", but they will have no way to do so.

Somewhat related to #18298

Orchard Core version

2.2.1

To Reproduce

  1. As an admin user, enable the OrchardCore.Users.Registration feature.
  2. Under Security > Settings > User Registration, check the "Users must verify their email address" setting.
  3. In an incognito window, browse to the site and register as a new user.
  4. At this stage, assume the user doesn't receive the confirmation email or allows it to expire
  5. Try to sign in.
  6. See notification indicating "You must confirm your email."
  7. There is no longer any way to confirm the email address aside from contacting an admin user or customer support to send a new email from the admin panel.

This would also affect customers created manually in the admin panel, via a recipe, etc. that do not have the EmailConfirmed property set to true on their User.

Expected behavior

It seems like a potential improvement would be to modify AccountController.AddConfirmEmailErrorAsync in OrchardCore.Users to send a confirmation email. By the time this method is invoked, the user's credentials have already been validated, so it would make sense to re-send the confirmation email and perhaps change the model state error in this method to "You must confirm your email. Please check your email for a link to verify your account." or something along those lines so that the user has a way of resolving the issue without needing to go through support.

Additional comments

This issue exists in base OrchardCore but is exacerbated by some custom user creation flows in my solution where we create users based on identity records in an external system and set the EmailConfirmed property to false when doing so.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions