From b9cf666581a50ae3be5f7f862ebf8f54606046f4 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 8 Aug 2018 00:23:46 +1000 Subject: [PATCH] Enabled password resets --- .../Auth/ResetPasswordController.php | 10 +- composer.json | 2 +- composer.lock | 8 +- public/js/app.js | 62 +++++--- .../auth/EmailResetPasswordForm.vue | 2 +- .../assets/js/components/auth/LoginForm.vue | 16 +- .../js/components/auth/ResetPasswordForm.vue | 4 +- resources/lang/en/message.php | 137 ------------------ 8 files changed, 64 insertions(+), 177 deletions(-) delete mode 100644 resources/lang/en/message.php diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 0b89538..1c1d940 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -38,10 +38,18 @@ class ResetPasswordController extends Controller $this->middleware('guest'); } + protected function rules() + { + return [ + 'token' => 'required', + 'email' => 'required|email|exists:users', + 'password' => 'required|confirmed|min:6', + ]; + } public function showResetForm(Request $request, $token = null) { return view('adminlte::auth.passwords.reset')->with( ['token' => $token, 'email' => $request->email] ); } -} +} \ No newline at end of file diff --git a/composer.json b/composer.json index 9a374ac..df56fb5 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "laravel/passport": "^6.0", "laravel/socialite": "^3.0", "laravel/tinker": "^1.0", - "leenooks/laravel": "^0.1.6", + "leenooks/laravel": "^0.2.0", "quickbooks/v3-php-sdk": "^5.0", "spatie/laravel-demo-mode": "^2.2", "spatie/laravel-failed-job-monitor": "^3.0", diff --git a/composer.lock b/composer.lock index 8170361..bde8f47 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "05d6e145f1dc63442830713daced798d", + "content-hash": "f7cb7e584d607fc891b5be4ddc0864dd", "packages": [ { "name": "acacha/user", @@ -2463,11 +2463,11 @@ }, { "name": "leenooks/laravel", - "version": "0.1.10", + "version": "0.2.0", "source": { "type": "git", "url": "https://dev.leenooks.net/leenooks/laravel", - "reference": "0bd32aab4a53a7f74d76a77165f973026ce90444" + "reference": "98b7b9f6a80274f40c7c02f3281ba78ecfb27603" }, "require": { "igaster/laravel-theme": "2.0.6", @@ -2503,7 +2503,7 @@ "laravel", "leenooks" ], - "time": "2018-08-01T06:28:10+00:00" + "time": "2018-08-07T14:14:48+00:00" }, { "name": "maximebf/debugbar", diff --git a/public/js/app.js b/public/js/app.js index 3770f88..b3dd60d 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -38013,8 +38013,8 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); }, computed: { placeholder: function placeholder() { - if (this.name === 'email') return this.trans('message.email'); - return this.trans('message.username'); + if (this.name === 'email') return this.trans('adminlte_lang_message.email'); + return this.trans('adminlte_lang_message.username'); }, type: function type() { if (this.name === 'email') return 'email'; @@ -38044,7 +38044,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); component.redirect(response); }, 2500); }).catch(function (error) { - console.log(_this.trans('message.loginerror') + ':' + error); + console.log(_this.trans('adminlte_lang_message.loginerror') + ':' + error); }); }, @@ -38103,9 +38103,9 @@ var render = function() { attrs: { id: "result" } }, [ - _vm._v(" " + _vm._s(_vm.trans("message.loggedin")) + " "), + _vm._v(_vm._s(_vm.trans("adminlte_lang_message.loggedin")) + " "), _c("i", { staticClass: "fa fa-refresh fa-spin" }), - _vm._v(" " + _vm._s(_vm.trans("message.entering"))) + _vm._v(" " + _vm._s(_vm.trans("adminlte_lang_message.entering"))) ] ), _vm._v(" "), @@ -38239,7 +38239,7 @@ var render = function() { staticClass: "form-control", attrs: { type: "password", - placeholder: _vm.trans("message.password"), + placeholder: _vm.trans("adminlte_lang_message.password"), name: "password" }, domProps: { value: _vm.form.password }, @@ -38317,7 +38317,11 @@ var render = function() { } } }), - _vm._v(" " + _vm._s(_vm.trans("message.remember")) + "\n ") + _vm._v( + " " + + _vm._s(_vm.trans("adminlte_lang_message.remember")) + + "\n " + ) ]) ]) ]), @@ -38328,7 +38332,11 @@ var render = function() { { staticClass: "btn btn-primary btn-block btn-flat", attrs: { type: "submit", disabled: _vm.form.errors.any() }, - domProps: { textContent: _vm._s(_vm.trans("message.buttonsign")) } + domProps: { + textContent: _vm._s( + _vm.trans("adminlte_lang_message.buttonsign") + ) + } }, [ _vm.form.submitting @@ -38530,18 +38538,22 @@ var render = function() { } }, [ - _c("div", { - directives: [ - { - name: "show", - rawName: "v-show", - value: _vm.form.succeeded, - expression: "form.succeeded" - } - ], - staticClass: "alert alert-success", - domProps: { textContent: _vm._s(_vm.result) } - }), + _c( + "div", + { + directives: [ + { + name: "show", + rawName: "v-show", + value: _vm.form.succeeded, + expression: "form.succeeded" + } + ], + staticClass: "alert alert-success text-center", + attrs: { id: "result" } + }, + [_vm._v(_vm._s(_vm.trans("adminlte_lang_message.resetemaillink")))] + ), _vm._v(" "), _c( "div", @@ -38798,7 +38810,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); var component = _this; setTimeout(function () { component.redirect(response); - }, 3000); + }, 2500); }).catch(function (error) { console.log(_this.trans('adminlte_lang_message.passwordreset') + ':' + error); }); @@ -38852,10 +38864,14 @@ var render = function() { expression: "form.succeeded" } ], - staticClass: "alert alert-success", + staticClass: "alert alert-success text-center", attrs: { id: "result" } }, - [_vm._v(_vm._s(_vm.result))] + [ + _vm._v(_vm._s(_vm.trans("adminlte_lang_message.success")) + " "), + _c("i", { staticClass: "fa fa-refresh fa-spin" }), + _vm._v(" " + _vm._s(_vm.trans("adminlte_lang_message.loggedin"))) + ] ), _vm._v(" "), _c("input", { diff --git a/resources/assets/js/components/auth/EmailResetPasswordForm.vue b/resources/assets/js/components/auth/EmailResetPasswordForm.vue index 6d2d6e9..59ef3eb 100644 --- a/resources/assets/js/components/auth/EmailResetPasswordForm.vue +++ b/resources/assets/js/components/auth/EmailResetPasswordForm.vue @@ -1,6 +1,6 @@