mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:27:09 +08:00
Return the proper error code when wrong password when changing email (#2171)
This commit is contained in:
parent
b87c7189cc
commit
5bca4fda9d
@ -12,7 +12,7 @@ namespace Flarum\Api\Controller;
|
||||
use Flarum\Api\Serializer\CurrentUserSerializer;
|
||||
use Flarum\Api\Serializer\UserSerializer;
|
||||
use Flarum\User\Command\EditUser;
|
||||
use Flarum\User\Exception\PermissionDeniedException;
|
||||
use Flarum\User\Exception\NotAuthenticatedException;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Illuminate\Support\Arr;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
@ -62,7 +62,7 @@ class UpdateUserController extends AbstractShowController
|
||||
$password = Arr::get($request->getParsedBody(), 'meta.password');
|
||||
|
||||
if (! $actor->checkPassword($password)) {
|
||||
throw new PermissionDeniedException;
|
||||
throw new NotAuthenticatedException;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user