Skip to content

Commit

Permalink
Merge branch 'thedevdojo:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hazbu authored Jul 26, 2023
2 parents 7906375 + 7069ba5 commit 6d005a9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 32 deletions.
49 changes: 23 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions wave/src/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,14 @@ public function profilePut(Request $request){
public function securityPut(Request $request){

$validator = Validator::make($request->all(), [
'current_password' => 'required',
'current_password' => 'required|current_password',
'password' => 'required|confirmed|min:'.config('wave.auth.min_password_length'),
]);

if ($validator->fails()) {
return back()->with(['message' => $validator->errors()->first(), 'message_type' => 'danger']);
}

if (! Hash::check($request->current_password, $request->user()->password)) {
return back()->with(['message' => 'Incorrect current password entered.', 'message_type' => 'danger']);
}

auth()->user()->forceFill([
'password' => bcrypt($request->password)
])->save();
Expand Down
2 changes: 1 addition & 1 deletion wave/src/Http/Livewire/Settings/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Security extends Component
protected function rules()
{
return [
'current_password' => 'required',
'current_password' => 'required|current_password',
'password' => 'required|confirmed|min:'.config('wave.auth.min_password_length')
];
}
Expand Down

0 comments on commit 6d005a9

Please sign in to comment.