N
N
NikSIk312020-03-09 00:47:14
Laravel
NikSIk31, 2020-03-09 00:47:14

Auth::login($user) not working with ajax?

$user = User::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => Hash::make($password),
            'api_token' => Str::random(60),
        ]);

        Auth::login($user);


I made an Ajax request for the route with the same code, returned OK, but did not authorize.
POST request, if
so it won't work? it is necessary that the normal request was?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question