Skip to content

Can resend another confirmation email when user trying to login by not being enabled #50

@bastien70

Description

@bastien70

Hey! When my user tries to log in when he is not activated, I display a notification telling him to activate his account, and I add a "Resend activation email" link.

If I want to be able to manage this, I will be forced, each time a user tries to connect, to generate a new unique link allowing them to access a route that will use the bundle to send a confirmation email.

In my UserChecker.php class :

    public function checkPreAuth(UserInterface $user)
    {

        if (!$user instanceof User) {
            return;
        }
        if (!$user->getEnabled() && !$user->isVerified()) {
            // $uniqueResendEmailurl = ....
            throw new CustomUserMessageAccountStatusException("Votre compte n'est pas activé. Veuillez confirmer 
            votre inscription en cliquant sur le lien qui vous a été envoyé par email. Pensez à vérifier dans vos spams. <a href=. "$uniqueResendEmailurl" . >Renvoyer l'email de confirmation</a>");
        }
    }

The bundle should really be able to integrate this functionality directly.

To counter this, I thought about using another of your bundles. The symfonycasts/reset-password-bundle

By creating a "ResendConfirmationEmailRequest" entity which is a full clone of the "ResetPasswordRequest" entity from your other bundle. And use the same methods to generate a unique signature to allow a user to receive a confirmation email again.

What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions