]> BookStack Code Mirror - bookstack/blobdiff - app/Exceptions/StoppedAuthenticationException.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / app / Exceptions / StoppedAuthenticationException.php
index ef7f24017904f1f85f39f5de26fa528ef479184e..8a917bc52261340889d6ea5259f4b4a005def92d 100644 (file)
@@ -2,28 +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)
     {
@@ -55,7 +49,7 @@ class StoppedAuthenticationException extends \Exception implements Responsable
             ], 401);
         }
 
-        if (session()->get('sent-email-confirmation') === true) {
+        if (session()->pull('sent-email-confirmation') === true) {
             return redirect('/register/confirm');
         }