Skip to content

Commit

Permalink
missing request user method call added
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Mar 30, 2024
1 parent e72ff90 commit d2484c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Http/Middlewares/LastLoggedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Fintech\Auth\Http\Middlewares;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;


class LastLoggedIn
{
Expand All @@ -27,7 +26,7 @@ public function handle(Request $request, \Closure $next)
*/
public function terminate(Request $request, $response): void
{
$user = Auth::user();
$user = $request->user('sanctum');

\Fintech\Auth\Facades\Auth::user()->updateRaw($user->getKey(), ['logged_in_at' => now()]);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Http/Middlewares/LastLoggedOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class LastLoggedOut
{
Expand All @@ -15,7 +14,7 @@ class LastLoggedOut
*/
public function handle(Request $request, Closure $next)
{
$user = Auth::user();
$user = $request->user('sanctum');

\Fintech\Auth\Facades\Auth::user()->updateRaw($user->getKey(), ['logged_out_at' => now()]);

Expand Down

0 comments on commit d2484c2

Please sign in to comment.