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

Feat / Creation of BackupCodeUsedEvent #252

Open
wants to merge 1 commit into
base: 7.x
Choose a base branch
from

Conversation

chaours
Copy link

@chaours chaours commented Oct 6, 2024

Description
This PR let us have a BackupCodeUsed event dispatching.
We wanted to send a addFlash message to inform that the backup code is now obsolete and highly recommand to generate a new one right now.
I hope this PR will interest you.
Thanks

@chaours
Copy link
Author

chaours commented Oct 6, 2024

Hum... Many errors... I can try fix them.

@chaours chaours force-pushed the feat-backupCodeUsed-event branch 4 times, most recently from 49eb1f9 to fe189bb Compare October 6, 2024 16:03
@scheb
Copy link
Owner

scheb commented Oct 12, 2024

There seems to be an issue with the unit test.

I also think, the implementation is a bit convoluted, as it introduces two extra dependencies into the CheckBackupCodeListener class, just to dispatch that event (the token at least could be taken from the passport object).

Though, TwoFactorAuthenticationEvents might not be the right event class for this. TwoFactorAuthenticationEvents was originally meant to represent the different phases of the 2fa process, so I think it's fair, if we'd introduce a dedicate event class for "checking codes". Could take the token (which contains information about the user) and the code as arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants