Auth 2FA: some issues

Solved
mgassend

Sep 26th, 2024 08:21 AM

Hey all,

I've been tinkering around with the auth package, but have run into some issues, especially with the 2FA section.

  • Am I missing something or is there no navigation to get back from the page where you can get the onetime codes ?
  • Trying to regenerate the codes throws an error saying that the mothod called is not defined in the page.

Am I doing something wrong ?

bobbyiliev

Sep 26th, 2024 11:19 AM

Best Answer

Hey!

Thanks for reporting that bug with the regenerate codes! I've got a PR with a fix for this:

https://github.com/thedevdojo/auth/pull/131

Regarding the navigation to the user 2fa page, if you are not utilizing Jetstream, you'll want a way for users to enable two-factor authentication. You can do this by directing users to /user/two-factor-authentication or you can iframe this page into your app so that you could use your own layout.

Hope that this helps!

- Bobby

tnylea

Sep 26th, 2024 11:31 AM

Thanks for submitting this!

I've went ahead and merged in the PR that Bobby submitted and I've tagged a new release with these fixes https://github.com/thedevdojo/auth/releases/tag/1.0.6

Appreciate it 😉

Report
1
mgassend

Sep 26th, 2024 10:26 PM

thank you all for the quick answers!

What I meant by redirection is that when the user navigates to the 2FA flow, there is no way for the user to go back to the application once 2FA is setup. Is this meant to be opened on a new page (or an iframe, I guess) ?

bobbyiliev

Sep 27th, 2024 12:54 AM

No worries, happy to help!

Yep, you can just use an iframe and you can embed that page into your application as you find fit! That way you will have your navigation as normal.

For example here is a simplified example on how to add this to the Breeze profile.blade.php file:

            <div class="p-4 bg-white shadow sm:p-8 dark:bg-gray-800 sm:rounded-lg">
                <div class="max-w-xl">
                    <iframe src="{{ url('/user/two-factor-authentication') }}" width="100%" height="800px" frameborder="0">
                        Your browser does not support iframes.
                    </iframe>
                </div>
            </div>

- Bobby

mgassend

Sep 27th, 2024 12:59 AM

ok, thank you for the example!

bobbyiliev

Sep 27th, 2024 01:00 AM

No problem! Good luck with your project!