Skip to content

Commit

Permalink
Fix pint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubka committed Oct 27, 2024
1 parent 461c1df commit e49556d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/Listeners/Authentication/LogoutListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function handle(mixed $event) : void
$user = $event->user;

if ($user != null) {
$ip = config('2fauth.proxy_headers.forIp')
$ip = config('2fauth.proxy_headers.forIp')
? $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip())
: $this->request->ip();
$userAgent = $this->request->userAgent();
Expand All @@ -66,7 +66,7 @@ public function handle(mixed $event) : void
}

$log->logout_at = now();
$user->authentications()->save($log);
$user->authentications()->save($log);
}
}
}
7 changes: 3 additions & 4 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
*/

/**
* Routes that only work for unauthenticated user (return an error otherwise)
* 'kickOutInactiveUser',
* Routes that only work for unauthenticated user (otherwise, the user is logged out)
*/
Route::group(['middleware' => ['rejectIfDemoMode', 'RejectIfSsoOnlyAndNotForAdmin', 'forceLogout']], function () {
Route::post('user', [RegisterController::class, 'register'])->name('user.register');
Expand All @@ -52,8 +51,8 @@
});

/**
* Routes that only work for unauthenticated user (return an error otherwise)
* that can be requested max 10 times per minute by the same IP 'kickOutInactiveUser',
* Routes that only work for unauthenticated user (otherwise, the user is logged out)
* that can be requested max 10 times per minute by the same IP
*/
Route::group(['middleware' => ['forceLogout', 'throttle:10,1']], function () {
Route::post('user/login', [LoginController::class, 'login'])->name('user.login')->middleware('RejectIfSsoOnlyAndNotForAdmin');
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Http/Auth/WebAuthnLoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function test_webauthn_login_already_authenticated_is_rejected()
->assertOk();

$this->json('POST', '/webauthn/login', self::ASSERTION_RESPONSE)
->assertStatus(200);;
->assertStatus(200);
}

#[Test]
Expand Down

0 comments on commit e49556d

Please sign in to comment.