mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-23 23:49:53 +01:00
Add user logging after WebAuthn authentication - Fix #109
This commit is contained in:
parent
855f16a8a1
commit
3f279f358c
@ -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();
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user