Authorize FormRequests to authenticated user only

This commit is contained in:
Bubka 2021-11-13 13:36:34 +01:00
parent f5e632b4e5
commit c8218c8cd7
13 changed files with 26 additions and 13 deletions

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class GroupAssignRequest extends FormRequest
{
@ -13,7 +14,7 @@ class GroupAssignRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class GroupStoreRequest extends FormRequest
{
@ -13,7 +14,7 @@ class GroupStoreRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class QrCodeDecodeRequest extends FormRequest
{
@ -13,7 +14,7 @@ class QrCodeDecodeRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class SettingStoreRequest extends FormRequest
{
@ -13,7 +14,7 @@ class SettingStoreRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class SettingUpdateRequest extends FormRequest
{
@ -13,7 +14,7 @@ class SettingUpdateRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class TwoFAccountBatchRequest extends FormRequest
{
@ -13,7 +14,7 @@ class TwoFAccountBatchRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -4,6 +4,7 @@
use Illuminate\Support\Arr;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class TwoFAccountDynamicRequest extends FormRequest
{
@ -14,7 +15,7 @@ class TwoFAccountDynamicRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class TwoFAccountReorderRequest extends FormRequest
{
@ -13,7 +14,7 @@ class TwoFAccountReorderRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class TwoFAccountStoreRequest extends FormRequest
{
@ -13,7 +14,7 @@ class TwoFAccountStoreRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class TwoFAccountUpdateRequest extends FormRequest
{
@ -13,7 +14,7 @@ class TwoFAccountUpdateRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class TwoFAccountUriRequest extends FormRequest
{
@ -13,7 +14,7 @@ class TwoFAccountUriRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class UserPatchPwdRequest extends FormRequest
{
@ -13,7 +14,7 @@ class UserPatchPwdRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**

View File

@ -3,6 +3,7 @@
namespace App\Api\v1\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class UserUpdateRequest extends FormRequest
{
@ -13,7 +14,7 @@ class UserUpdateRequest extends FormRequest
*/
public function authorize()
{
return true;
return Auth::check();
}
/**