Laragear / TwoFactor

Two-Factor Authentication for all your users out-of-the-box.
https://github.com/sponsors/DarkGhostHunter
MIT License
273 stars 20 forks source link

Issue with migrating from darkghosthunter/laraguard #46

Closed es-roshanb closed 1 year ago

es-roshanb commented 1 year ago

PHP & Platform

8.1.17

Database

Mysql 8.0.32

Laravel version

10

Have you done this?

Expectation

It should be able to create createTwoFactorAuth for logged in user. I see that the secret key are stored differently in two version. Did I miss any documentation to migrate properly?

Description

So I updated laravel from 8 to 10, and also have migrated from darkghosthunter/laraguard => Laragear/TwoFactor. So there is no any issue with doing new setup, but for the one which was setup from old version it gives payload issue. Please check the attachment. Screen Shot 2023-04-21 at 9 55 11 AM

Reproduction

$secret = $this->loggedInUser->createTwoFactorAuth();

Stack trace & logs

No response

DarkGhostHunter commented 1 year ago

That's a Crypt error. I can't see the full stack trace, so that's my guess, and shouldn't be a problem in the library.

jonathan-bird commented 1 year ago

This happens when you have existing items in two_factor_authentications when migrating. Removing the existing items gets it to work. I imagine a difference between the two libraries when migrating.