Change back to 401 error on invalid login

See 26a821e3e2 (commitcomment-13866552)
This commit is contained in:
Toby Zerner
2015-10-21 09:04:58 +10:30
parent 6d7b826133
commit 12830265d9
3 changed files with 7 additions and 12 deletions

View File

@ -11,12 +11,12 @@
namespace Flarum\Api\Controller;
use Flarum\Api\Command\GenerateAccessToken;
use Flarum\Core\Exception\PermissionDeniedException;
use Flarum\Core\Repository\UserRepository;
use Flarum\Event\UserEmailChangeWasRequested;
use Flarum\Http\Controller\ControllerInterface;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
@ -62,7 +62,7 @@ class TokenController implements ControllerInterface
$user = $this->users->findByIdentification($identification);
if (! $user || ! $user->checkPassword($password)) {
throw new ModelNotFoundException;
throw new PermissionDeniedException;
}
if (! $user->is_activated) {