mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-28 08:04:45 +02:00
Reject requests for public key auth when the user has no keys
This commit is contained in:
parent
12927a3202
commit
e856daee19
@ -43,6 +43,12 @@ abstract class SftpAuthenticationController extends Controller
|
||||
if (!password_verify($request->input('password'), $user->password)) {
|
||||
$this->reject($request);
|
||||
}
|
||||
} else {
|
||||
// Start blocking requests when the user has no public keys in the first place —
|
||||
// don't let the user spam this endpoint.
|
||||
if ($user->sshKeys->isEmpty()) {
|
||||
$this->reject($request);
|
||||
}
|
||||
}
|
||||
|
||||
$this->validateSftpAccess($user, $server);
|
||||
|
Loading…
x
Reference in New Issue
Block a user