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? (30 h 41 min)

You also get:

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

Already a member? Login here

Comments & Discussion

NS
Ngozi Stephen Onyemauche ✓ Link copied!

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']);

NS
Ngozi Stephen Onyemauche ✓ Link copied!

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

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.