diff --git a/app/Http/Controllers/Auth/WebAuthnLoginController.php b/app/Http/Controllers/Auth/WebAuthnLoginController.php index dc5750b7..92c0bace 100644 --- a/app/Http/Controllers/Auth/WebAuthnLoginController.php +++ b/app/Http/Controllers/Auth/WebAuthnLoginController.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use App\Http\Controllers\Controller; use DarkGhostHunter\Larapass\Http\AuthenticatesWebAuthn; +use Carbon\Carbon; class WebAuthnLoginController extends Controller { @@ -73,4 +74,19 @@ public function login(Request $request) return $this->traitLogin($request); } + + + /** + * The user has been authenticated. + * + * @param \Illuminate\Http\Request $request + * @param mixed $user + * + * @return void|\Illuminate\Http\JsonResponse + */ + protected function authenticated(Request $request, $user) + { + $user->last_seen_at = Carbon::now()->format('Y-m-d H:i:s'); + $user->save(); + } } \ No newline at end of file diff --git a/app/Http/Middleware/LogUserLastSeen.php b/app/Http/Middleware/LogUserLastSeen.php index 50d789d2..e971cc02 100644 --- a/app/Http/Middleware/LogUserLastSeen.php +++ b/app/Http/Middleware/LogUserLastSeen.php @@ -16,7 +16,7 @@ class LogUserLastSeen * @param string|null $guard * @return mixed */ - public function handle($request, Closure $next, ...$quards) + public function handle($request, Closure $next, ...$guards) { $guards = empty($guards) ? [null] : $guards;