Skip to main content

Login Form and First Authentication

Premium
8:34

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Ngozi Stephen Onyemauche avatar
Ngozi Stephen Onyemauche

Please i have been trying to login to my dashboard and i am getting this error response "App\Http\Controllers\Auth\AuthenticatedSessionController::store(): Return value must be of type Illuminate\Http\RedirectResponse, Illuminate\Http\JsonResponse returned"

this is my AuthenticatedSessionController store method public function store(LoginRequest $request): RedirectResponse { $request->authenticate();

$request->session()->regenerate();
 
if ($request->wantsJson()) {
return response()->json($request->user());
}
return redirect()->intended(RouteServiceProvider::HOME);

}

this is my web.php Route::post('login', [AuthenticatedSessionController::class, 'store']);

Ngozi Stephen Onyemauche avatar
Ngozi Stephen Onyemauche

Yes i have found the answer, in laravel 9 AuthenticatedSessionController store method had RedirectResponse attached to it which i removed

👍 1

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.