Skip to content

Conversation

@jrushlow
Copy link
Collaborator

@jrushlow jrushlow commented Jan 6, 2021

By passing the user id as an extra query param to VerifyEmailHelper::generateSignature() - users are able to verify their email address without being authenticated.

As a precautionary note, answering no to Do you want to require the user to be authenticated to verify their email? will allow anyone with the link generated by VerifyEmailHelper to validated that users email address. It should also be advised that answering no could possibly leak personally identifiable information in log files if the user id is changed to say, a users email address.

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Only minor comments


$input->setArgument(
'verify-email-with-auth',
$io->confirm('Do you want to require the user to be authenticated to verify their email?', true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm trying to think about how a person would understand this... and the wording on it. Maybe we give some extra info before?

To verify their email address, you can either require that users are authenticated when they click
the verification link or allow them to be anonymous (e.g. maybe they click the link on a different
device).

Allow anonymous users to verify their email?

(and default to no)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we have this nailed down now

@jrushlow jrushlow added Status: Needs Work Additional work is needed Related Tests Pass and removed Related Tests Pass Status: Needs Work Additional work is needed labels Jan 8, 2021
@weaverryan weaverryan force-pushed the feature/verify-email-no-auth branch from 7f198ee to ebdb227 Compare January 8, 2021 18:14
@weaverryan
Copy link
Member

Thank you Jesse!

@weaverryan weaverryan merged commit a47408f into symfony:main Jan 8, 2021
@PetarBelberov
Copy link

After [make:registration] where I need to change the code to allow email verification without authentication?

@weaverryan
Copy link
Member

@PetarBelberov if you're using the newest version of Maker, which includes this PR, then make:registration will ask you interactively whether or not you want to allow verification without authentication. And so, you should not need to make any changes.

If you've previously executed this command, adapt the changes from these 2 files into your app:

We also have it documented here: https://github.com/symfonycasts/verify-email-bundle#anonymous-validation

Cheers!

@PetarBelberov
Copy link

@weaverryan, yes, the issue was from the current version I used. I am a lucky guy with this brand new update. Thank you for the help. All the best!

@jrushlow jrushlow deleted the feature/verify-email-no-auth branch January 30, 2021 19:16
EmmanuelBlanchard added a commit to EmmanuelBlanchard/OpenClassroomsProject5 that referenced this pull request May 17, 2021
… his account if we don't want the user to be logged in after the account creation request. So according to weaverryan on the page symfony/maker-bundle#776 : the solution is to redo a symfony make:registration by deleting all files related to registration : src/Controller/RegistrationController.php, src/Form/RegistrationFormType.php, src/Security/EmailVerifier.php, templates/registration/confirmation_email.html.twig, templates/registration/register.html.twig.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants