zacksmash / fortify-ui

Laravel Fortify driven replacement to the Laravel UI package
https://github.com/zacksmash/fortify-ui
MIT License
242 stars 20 forks source link

When I click the "Enable Two-Factor" button I get an error #32

Closed bit-pax closed 4 months ago

bit-pax commented 1 year ago

When I click the "Enable Two-Factor" button I get the following error:

Target [Laravel\Fortify\Contracts\ConfirmPasswordViewResponse] is not instantiable.

The url it takes me to is:

/user/confirm-password

but I don't a user folder with a confirm-password blade. There is a confirm-password blade file in the auth folder. Is it supposed to route to that one?

--

EDIT: I realized uncommenting the following lines in the FortifyUIServiceProvider fixes the error:

    Fortify::confirmPasswordView(function () {
        return view('auth.confirm-password');
    });

    Fortify::twoFactorChallengeView(function () {
        return view('auth.two-factor-challenge');
    });

However I get the following error:

Call to undefined method App\Models\User::twoFactorQrCodeSvg()

Looks like it's the part that would display an image for Google Authenticator but it seems this class doesn't exist. Could use a little help.

zacksmash commented 1 year ago

Have you followed these instructions:

https://github.com/zacksmash/fortify-ui#two-factor-authentication