mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-26 06:52:13 +02:00
Fix TwoFAccount update validation rules again
This commit is contained in:
parent
8eae21e4da
commit
7bef68e731
@ -24,15 +24,15 @@ class TwoFAccountUpdateRequest extends FormRequest
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'service' => 'required|nullable|string|regex:/^[^:]+$/i',
|
'service' => 'present|nullable|string|regex:/^[^:]+$/i',
|
||||||
'account' => 'required|string|regex:/^[^:]+$/i',
|
'account' => 'required|string|regex:/^[^:]+$/i',
|
||||||
'icon' => 'required|nullable|string',
|
'icon' => 'present|nullable|string',
|
||||||
'otp_type' => 'required|string|in:totp,hotp',
|
'otp_type' => 'required|string|in:totp,hotp',
|
||||||
'secret' => ['required', 'string', 'bail', new \App\Rules\IsBase32Encoded],
|
'secret' => ['present', 'string', 'bail', new \App\Rules\IsBase32Encoded],
|
||||||
'digits' => 'required|integer|between:6,10',
|
'digits' => 'present|integer|between:6,10',
|
||||||
'algorithm' => 'required|string|in:sha1,sha256,sha512,md5',
|
'algorithm' => 'present|string|in:sha1,sha256,sha512,md5',
|
||||||
'period' => 'required_if:otp_type,totp|nullable|integer|min:1',
|
'period' => 'nullable|integer|min:1',
|
||||||
'counter' => 'required_if:otp_type,hotp|nullable|integer|min:0',
|
'counter' => 'nullable|integer|min:0',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user