Skip to content

Commit f77bdee

Browse files
Merge pull request #415 from vidhyut-pandya/develop
Bug fixes
2 parents 61d2b39 + e0a97fd commit f77bdee

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

app/Http/Requests/Backend/Access/User/UpdateUserPasswordRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class UpdateUserPasswordRequest extends Request
1616
*/
1717
public function authorize()
1818
{
19-
return access()->allow('edit-user');
19+
return true;
2020
}
2121

2222
/**

app/Models/Access/User/User.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,6 @@ public function getJWTIdentifier()
7979
return $this->getKey();
8080
}
8181

82-
/**
83-
* Set password attribute.
84-
*
85-
* @param [string] $password
86-
*/
87-
public function setPasswordAttribute($password)
88-
{
89-
if (!empty($password)) {
90-
$this->attributes['password'] = bcrypt($password);
91-
}
92-
}
93-
9482
/**
9583
* Return a key value array, containing any custom claims to be added to the JWT.
9684
*

app/Repositories/Backend/Access/User/UserRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function updatePassword($user, $input)
177177
$user = $this->find(access()->id());
178178

179179
if (Hash::check($input['old_password'], $user->password)) {
180-
$user->password = $input['password'];
180+
$user->password = Hash::make($input['password']);
181181

182182
if ($user->save()) {
183183
event(new UserPasswordChanged($user));
@@ -393,7 +393,7 @@ protected function createUserStub($input)
393393
$user->first_name = $input['first_name'];
394394
$user->last_name = $input['last_name'];
395395
$user->email = $input['email'];
396-
$user->password = $input['password'];
396+
$user->password = Hash::make($input['password']);
397397
$user->status = isset($input['status']) ? 1 : 0;
398398
$user->confirmation_code = md5(uniqid(mt_rand(), true));
399399
$user->confirmed = isset($input['confirmed']) ? 1 : 0;

app/Repositories/Frontend/Access/User/UserRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function create(array $data, $provider = false)
9696
$user->email = $data['email'];
9797
$user->confirmation_code = md5(uniqid(mt_rand(), true));
9898
$user->status = 1;
99-
$user->password = $provider ? null : $data['password'];
99+
$user->password = $provider ? null : Hash::make($data['password']);
100100
$user->is_term_accept = $data['is_term_accept'];
101101

102102
// If users require approval, confirmed is false regardless of account type
@@ -284,7 +284,7 @@ public function changePassword($input)
284284
$user = $this->find(access()->id());
285285

286286
if (Hash::check($input['old_password'], $user->password)) {
287-
$user->password = $input['password'];
287+
$user->password = Hash::make($input['password']);
288288

289289
if ($user->save()) {
290290
$user->notify(new UserChangedPassword($input['password']));

0 commit comments

Comments
 (0)