laravel / jetstream

Tailwind scaffolding for the Laravel framework.
https://jetstream.laravel.com
MIT License
3.93k stars 809 forks source link

Unable to enable Two Factor Authentication #1462

Closed Schrijvers123 closed 3 months ago

Schrijvers123 commented 3 months ago

Jetstream Version

5.0.1

Jetstream Stack

Inertia

Laravel Version

11.1.1

PHP Version

8.3.4

Database Driver & Version

No response

Description

It appears that enabling Two-Factor Authentication is currently impossible. When I am logged in and navigate to my user profile, I encounter a section where I should be able to activate Two-Factor Multi-Authentication. Unfortunately, it doesn't seem to work.

In the console, I receive the message 'Uncaught ReferenceError: axios is not defined afbeelding

Steps To Reproduce

Just got to your profile and try to enable two way multifacty authentication

driesvints commented 3 months ago

I can enable 2fa just fine on a fresh jetstream install with inertia.

Schrijvers123 commented 3 months ago

thanks for the update. Will debug more. Need to find wht COnfirmpassword.vue cause an axios error.

Schrijvers123 commented 3 months ago

Found a solution. Due to the fact I am not using Bootstrap, but Tailwin. I added the following code to app.js:

import axios from 'axios';

window.axios = axios;

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

After this it was working.