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

[2.x] Events for Two Factor Authentication #162

Merged
merged 6 commits into from
Dec 18, 2020

Conversation

joelbutcher
Copy link
Contributor

This PR adds three events to fortify that get fired in the given scenarios:

  1. Two factor is enabled
  2. Two factor is disabled
  3. User generates new recovery code

I'm unsure in the last one whether or not to pass the recovery code to the event - can someone advise whether or not this would be useful?

Inspired by the closed issue on Laravel Jetstream requesting the logic be overwritten / extendable.

@taylorotwell
Copy link
Member

Can you name the events "TwoFactorAuthenticationDisabled" etc.

@joelbutcher
Copy link
Contributor Author

@taylorotwell done!

@taylorotwell taylorotwell merged commit 8105a1a into laravel:master Dec 18, 2020
@joelbutcher joelbutcher deleted the 2fa-events branch January 15, 2021 18:21
@driesvints
Copy link
Member

@joelbutcher @danclaytondev can any of you two send this PR and #239 to 1.x? It's unnecessary to do a new major release for those.

joelbutcher added a commit to joelbutcher/fortify that referenced this pull request Jan 7, 2022
* added events

* dispatch events

* added tests for events

* Style CI fixes

* rename events

* fix usages

(cherry picked from commit 8105a1a)
@joelbutcher joelbutcher mentioned this pull request Jan 7, 2022
@joelbutcher
Copy link
Contributor Author

joelbutcher commented Jan 7, 2022

@driesvints Done 👍

taylorotwell pushed a commit that referenced this pull request Jan 7, 2022
* [2.x] Events for Two Factor Authentication (#162)

* added events

* dispatch events

* added tests for events

* Style CI fixes

* rename events

* fix usages

(cherry picked from commit 8105a1a)

* [2.x] Dispatch Event when Two Factor Challenged (#239)

* dispatch event when two factor challenged and test

* use statements styleci

(cherry picked from commit b490728)

Co-authored-by: danclaytondev <[email protected]>
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.

3 participants