Skip to content

Commit 6fec3ba

Browse files
committed
Fix users not being able to change their passwords ...
.. unless they're super users. Check the IDs instead of the objects, since they might be different instances of the same user object.
1 parent 9c971e2 commit 6fec3ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Policies/UserPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function editPassword($authed, $user)
4949
$user = User::fromUser($user);
5050
$authed = User::fromUser($authed);
5151

52-
if ($authed === $user) {
52+
if ($authed->id() === $user->id()) {
5353
return true; // Users may change their own passwords.
5454
}
5555

0 commit comments

Comments
 (0)