inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.01k stars 224 forks source link

Login not working with Laravel + Inertia + React #567

Closed Hernanarica closed 6 months ago

Hernanarica commented 8 months ago

Hello, I realized that Laravel's manual authentication does not work with inertia, I am doing everything as the documentation says but the user's credentials are not kept saved.

web.php

Captura de pantalla 2023-12-04 a las 22 57 49

AuthController

Captura de pantalla 2023-12-04 a las 22 57 40

SignIn view React

Captura de pantalla 2023-12-04 a las 22 57 54

HandleInertiaRequest

Captura de pantalla 2023-12-04 a las 23 32 19

Error

Captura de pantalla 2023-12-04 a las 23 32 38
taylorotwell commented 6 months ago

I would suggest looking at how the Laravel Breeze + React Inertia stack works.

FuzzyNat26 commented 1 week ago

Hi! @Hernanarica

I know this issue has been closed, but I've encountered the same situation. Have you made any discovery regarding this topic?

Hernanarica commented 1 week ago

@FuzzyNat26 Hello! Yes, since I was never able to solve it from the programming side, what I did was create a new project and start everything from scratch, migrating the views, controllers, etc., etc., and the authentication now worked.

FuzzyNat26 commented 1 week ago

Thanks for the reply.

I came across the same conclusion, which is pretty weird on what's bugged out the authentication.