LifeOnScreen / nova-google2fa

This package provides Google2FA support to Laravel Nova.
23 stars 56 forks source link

Tweaks and Upgrades #34

Open tonysm opened 2 years ago

tonysm commented 2 years ago

Changed


Hey, there. I had the need to implement in Nova for an app, tried installing your package but found some roadblocks (my project uses PHP >8.0), so I made the necessary changes to make it work and figured I could contribute here.

While I was testing it, I noticed that the recovery flow wasn't working, so I fixed that. And then I noticed I had to reconfigure the authenticator app after using a recovery code (it generated a new secret and new codes), but that doesn't seem necessary. Fortify just replaces the used code with a new one, so that should do the trick, right?

These are all breaking changes, so you may need a major version bump. Since I'm working on a new project, I didn't need to migrate existing users, and I don't think it's possible (because of the hashing to encryption change), so if you're interested in a migration path for users of the package, we can bring back the hashing stuff implement a configuration that allows users to choose between encryption/hashing for the recovery codes.

I changed from hashing to encryption to allow users to view their recovery codes again once they are inside the app (since recovery codes change - when you use one, that one gets cycled and a new one takes its place).

interpegasus commented 2 years ago

Great work! Does it support Nova 4?

tonysm commented 2 years ago

@interpegasus nope. These changes were made before Nova 4, unfortunately.