Skip to content

Commit 1841f13

Browse files
committed
change backend create user + reset password hashing
1 parent 21fe7d6 commit 1841f13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Repositories/UserRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function store(array $params)
124124
}
125125
$setting = Setting::get('main');
126126
$secret = mksecret();
127-
$passhash = md5($secret . $password . $secret);
127+
$passhash = hash('sha256', $secret . hash('sha256', $password));
128128
$data = [
129129
'username' => $username,
130130
'email' => $email,
@@ -161,7 +161,7 @@ public function resetPassword($id, $password, $passwordConfirmation)
161161
$this->checkPermission($operator, $user);
162162
}
163163
$secret = mksecret();
164-
$passhash = md5($secret . $password . $secret);
164+
$passhash = hash('sha256', $secret . hash('sha256', $password));
165165
$update = [
166166
'secret' => $secret,
167167
'passhash' => $passhash,

0 commit comments

Comments
 (0)