]> BookStack Code Mirror - bookstack/blobdiff - app/Exceptions/StoppedAuthenticationException.php
Added additional testing for editor switching permissions
[bookstack] / app / Exceptions / StoppedAuthenticationException.php
index 7a978ffc61428ad6015dbc7d8170b8a2eac34b89..b9aadb03f33e3aaa4a3a7c03d46916ce511aaade 100644 (file)
@@ -9,7 +9,6 @@ use Illuminate\Http\Request;
 
 class StoppedAuthenticationException extends \Exception implements Responsable
 {
-
     protected $user;
     protected $loginService;
 
@@ -24,7 +23,7 @@ class StoppedAuthenticationException extends \Exception implements Responsable
     }
 
     /**
-     * @inheritdoc
+     * {@inheritdoc}
      */
     public function toResponse($request)
     {
@@ -50,16 +49,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
+}