X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/cac31b2074cc0429423ffe7b8646ca0b5b367fe6..refs/pull/5676/head:/app/Exceptions/StoppedAuthenticationException.php diff --git a/app/Exceptions/StoppedAuthenticationException.php b/app/Exceptions/StoppedAuthenticationException.php index 7a978ffc6..8a917bc52 100644 --- a/app/Exceptions/StoppedAuthenticationException.php +++ b/app/Exceptions/StoppedAuthenticationException.php @@ -2,29 +2,22 @@ namespace BookStack\Exceptions; -use BookStack\Auth\Access\LoginService; -use BookStack\Auth\User; +use BookStack\Access\LoginService; +use BookStack\Users\Models\User; use Illuminate\Contracts\Support\Responsable; use Illuminate\Http\Request; class StoppedAuthenticationException extends \Exception implements Responsable { - - protected $user; - protected $loginService; - - /** - * StoppedAuthenticationException constructor. - */ - public function __construct(User $user, LoginService $loginService) - { - $this->user = $user; - $this->loginService = $loginService; + public function __construct( + protected User $user, + protected LoginService $loginService + ) { parent::__construct(); } /** - * @inheritdoc + * {@inheritdoc} */ public function toResponse($request) { @@ -50,16 +43,16 @@ class StoppedAuthenticationException extends \Exception implements Responsable if ($request->wantsJson()) { return response()->json([ 'error' => [ - 'code' => 401, + 'code' => 401, 'message' => trans('errors.email_confirmation_awaiting'), ], ], 401); } - if (session()->get('sent-email-confirmation') === true) { + if (session()->pull('sent-email-confirmation') === true) { return redirect('/register/confirm'); } return redirect('/register/confirm/awaiting'); } -} \ No newline at end of file +}