fix(onboarding): validate ssh username

This commit is contained in:
ShadowArcanist 2026-05-06 21:21:57 +05:30
parent ff4794ffec
commit 7c97b8bfb3
No known key found for this signature in database

View file

@ -278,7 +278,7 @@ public function saveServer()
'remoteServerName' => 'required|string', 'remoteServerName' => 'required|string',
'remoteServerHost' => 'required|string', 'remoteServerHost' => 'required|string',
'remoteServerPort' => 'required|integer', 'remoteServerPort' => 'required|integer',
'remoteServerUser' => 'required|string', 'remoteServerUser' => 'required|string|regex:/^[a-zA-Z0-9._-]+$/',
]); ]);
$this->privateKey = formatPrivateKey($this->privateKey); $this->privateKey = formatPrivateKey($this->privateKey);
@ -467,7 +467,7 @@ public function saveAndValidateServer()
{ {
$this->validate([ $this->validate([
'remoteServerPort' => 'required|integer|min:1|max:65535', 'remoteServerPort' => 'required|integer|min:1|max:65535',
'remoteServerUser' => 'required|string', 'remoteServerUser' => 'required|string|regex:/^[a-zA-Z0-9._-]+$/',
]); ]);
$this->createdServer->update([ $this->createdServer->update([