mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-24 16:09:14 +01:00
Enforce Create form validation
This commit is contained in:
parent
657b9288da
commit
acd1b2deca
@ -37,10 +37,10 @@ public function store(Request $request)
|
|||||||
|
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'service' => 'required|string',
|
'service' => 'required|string',
|
||||||
'account' => 'nullable|string',
|
'account' => 'required_without:uri|nullable|string|regex:/^[^:]+$/i',
|
||||||
'icon' => 'nullable|string',
|
'icon' => 'nullable|string',
|
||||||
'uri' => 'nullable|string|regex:/^otpauth:\/\/[h,t]otp\//i',
|
'uri' => 'nullable|string|regex:/^otpauth:\/\/[h,t]otp\//i',
|
||||||
'otpType' => 'required_without:uri|in:TOTP,HOTP',
|
'otpType' => 'required_without:uri|in:totp,hotp,TOTP,HOTP',
|
||||||
'secret' => 'required_without:uri|string',
|
'secret' => 'required_without:uri|string',
|
||||||
'digits' => 'nullable|integer|between:6,10',
|
'digits' => 'nullable|integer|between:6,10',
|
||||||
'algorithm' => 'nullable|in:sha1,sha256,sha512,md5',
|
'algorithm' => 'nullable|in:sha1,sha256,sha512,md5',
|
||||||
|
@ -148,6 +148,10 @@
|
|||||||
'secret' => [
|
'secret' => [
|
||||||
'required_without' => 'The :attribute field is required.',
|
'required_without' => 'The :attribute field is required.',
|
||||||
],
|
],
|
||||||
|
'account' => [
|
||||||
|
'required_without' => 'The :attribute field is required.',
|
||||||
|
'regex' => 'The :attribute field must not contain colon.',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user