ozziexsh/laravel-jetstream-react

Two Factor QR Code doesnt show up

Closed this issue · 1 comments

Hello,

yesterday i installed the "laravel-jetstream-react-installer" and tried to activate the Two Factor Auth. After i clicked "ENABLE" and entered my password it directly showed the ENABLE button again. It just was a short period the QR Code showed up.
In the "network" tab i saw, that the "user/two-factor-authentication" POST request got a 302 (Redirect) response. That results in reloading the page to user/profile route.

The only reason for me is, that the function returns a JSON response, but the post request sends a "Accept" header for text/html. In the script that would output a redirect to the page before.

Does anyone know why this happens and how to fix this?

Best regards
Debiano

Hey thanks for reporting this!

It looks like it was an issue using Inertia.post which was triggering a page reload. I swapped it out with axios.post and then reloaded Inertia's props manually using Inertia.reload which does a fetch instead of a full page refresh.

The code can be found in #6 and it has been released in v0.2.5 1700e47

Have a look at the diff and patch your code manually (it's a small change :)), or update your installer to v0.2.5 and use it on a new project