From 8ee0817dc3f24fd6c661d2ea704faa617ccf197f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 1 Apr 2020 12:43:20 +0200 Subject: [PATCH] wip #3490 @1 --- app/Console/Kernel.php | 3 - .../Auth/ConfirmPasswordController.php | 40 ++++++++++ .../Auth/ForgotPasswordController.php | 22 ++++++ app/Http/Controllers/Auth/LoginController.php | 40 ++++++++++ .../Controllers/Auth/RegisterController.php | 73 +++++++++++++++++++ .../Auth/ResetPasswordController.php | 30 ++++++++ .../Auth/VerificationController.php | 42 +++++++++++ app/Http/Requests/ProjectRequest.php | 56 -------------- composer.lock | 10 +-- 9 files changed, 252 insertions(+), 64 deletions(-) create mode 100644 app/Http/Controllers/Auth/ConfirmPasswordController.php create mode 100644 app/Http/Controllers/Auth/ForgotPasswordController.php create mode 100644 app/Http/Controllers/Auth/LoginController.php create mode 100644 app/Http/Controllers/Auth/RegisterController.php create mode 100644 app/Http/Controllers/Auth/ResetPasswordController.php create mode 100644 app/Http/Controllers/Auth/VerificationController.php delete mode 100644 app/Http/Requests/ProjectRequest.php diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index f521836..9d8c203 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -24,9 +24,6 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - // $schedule->command('inspire') - // ->hourly(); - $schedule->command('backup:clean')->daily()->at('04:00'); $schedule->command('backup:run')->daily()->at('05:00'); } diff --git a/app/Http/Controllers/Auth/ConfirmPasswordController.php b/app/Http/Controllers/Auth/ConfirmPasswordController.php new file mode 100644 index 0000000..138c1f0 --- /dev/null +++ b/app/Http/Controllers/Auth/ConfirmPasswordController.php @@ -0,0 +1,40 @@ +middleware('auth'); + } +} diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php new file mode 100644 index 0000000..465c39c --- /dev/null +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -0,0 +1,22 @@ +middleware('guest')->except('logout'); + } +} diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php new file mode 100644 index 0000000..c6a6de6 --- /dev/null +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -0,0 +1,73 @@ +middleware('guest'); + } + + /** + * Get a validator for an incoming registration request. + * + * @param array $data + * @return \Illuminate\Contracts\Validation\Validator + */ + protected function validator(array $data) + { + return Validator::make($data, [ + 'name' => ['required', 'string', 'max:255'], + 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], + 'password' => ['required', 'string', 'min:8', 'confirmed'], + ]); + } + + /** + * Create a new user instance after a valid registration. + * + * @param array $data + * @return \App\User + */ + protected function create(array $data) + { + return User::create([ + 'name' => $data['name'], + 'email' => $data['email'], + 'password' => Hash::make($data['password']), + ]); + } +} diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php new file mode 100644 index 0000000..b1726a3 --- /dev/null +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -0,0 +1,30 @@ +middleware('auth'); + $this->middleware('signed')->only('verify'); + $this->middleware('throttle:6,1')->only('verify', 'resend'); + } +} diff --git a/app/Http/Requests/ProjectRequest.php b/app/Http/Requests/ProjectRequest.php deleted file mode 100644 index 94e0553..0000000 --- a/app/Http/Requests/ProjectRequest.php +++ /dev/null @@ -1,56 +0,0 @@ -check(); - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - // 'name' => 'required|min:5|max:255' - ]; - } - - /** - * Get the validation attributes that apply to the request. - * - * @return array - */ - public function attributes() - { - return [ - // - ]; - } - - /** - * Get the validation messages that apply to the request. - * - * @return array - */ - public function messages() - { - return [ - // - ]; - } -} diff --git a/composer.lock b/composer.lock index 78aa73a..7351f84 100644 --- a/composer.lock +++ b/composer.lock @@ -965,13 +965,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_cms-back.git", - "reference": "0c5d3e6d56e462aa10a39588f9d1700def0e50f3" + "reference": "e3313e370bc3e4ee36cc0c36cffda94efbdc93ca" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-298546.tar", - "reference": "0c5d3e6d56e462aa10a39588f9d1700def0e50f3", - "shasum": "e741816e9db84bcb6f64965032aaae89193f6a13" + "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-fa7dbb.tar", + "reference": "e3313e370bc3e4ee36cc0c36cffda94efbdc93ca", + "shasum": "bcc79dd5117133e1deae4cac2b5d5f6e00b30a0e" }, "require": { "backpack/backupmanager": "^2.0", @@ -1042,7 +1042,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2020-03-30T18:35:53+00:00" + "time": "2020-04-01T10:13:05+00:00" }, { "name": "cubist/cms-front", -- 2.39.5