Skip to content

Commit c172435

Browse files
committed
fix: authenticate user while login
1 parent 8b3a268 commit c172435

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Http/Controllers/Auth/LoginController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Binaryk\LaravelRestify\Tests\Fixtures\User\User;
66
use Illuminate\Http\Request;
77
use Illuminate\Routing\Controller;
8+
use Illuminate\Support\Facades\Auth;
89
use Illuminate\Support\Facades\Hash;
910

1011
class LoginController extends Controller
@@ -27,6 +28,8 @@ public function __invoke(Request $request)
2728
abort(401, 'Invalid credentials.');
2829
}
2930

31+
Auth::login($user);
32+
3033
return rest($user)->indexMeta([
3134
'token' => $user->createToken('login')->plainTextToken,
3235
]);

0 commit comments

Comments
 (0)