Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block login when isVerified is False #190

Open
keoozDan opened this issue Jul 29, 2024 · 1 comment
Open

Block login when isVerified is False #190

keoozDan opened this issue Jul 29, 2024 · 1 comment
Labels
Status: Reviewed Has been reviewed by a maintainer

Comments

@keoozDan
Copy link

I think that user with isVerified is false can login.

How can we block the login because :
1/ In app_verify_email we use : $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
2/ In UserChecker.php : we can't block for false isVerified because we block the verification too

Have you any solution ?

@jrushlow
Copy link
Collaborator

Howdy @keoozDan - In very broad, general terms, it's usually best to allow a user to authenticate (Authentication) regardless if they're "verified" or not. To prevent access (Authorization) to all or part of an application for "non-verified" users, Symfony's Security Voter system can help with that depending on your needs. https://symfony.com/doc/current/security/voters.html

If you really want to only allow users who have verified their email address to be able to login (authentication), then you would probably need to use a custom authenticator or some sort of custom security events to handle that gracefully.

Hope this helps!

@jrushlow jrushlow added the Status: Reviewed Has been reviewed by a maintainer label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants