]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Auth/AuthController.php
Updated all application urls to allow path prefix.
[bookstack] / app / Http / Controllers / Auth / AuthController.php
index ef44b2aef9834f62920338c211086223c9cf761e..2cbc047ce75621a20029bf31fa7409601cfe1e87 100644 (file)
@@ -1,9 +1,6 @@
-<?php
-
-namespace BookStack\Http\Controllers\Auth;
+<?php namespace BookStack\Http\Controllers\Auth;
 
 use BookStack\Exceptions\AuthException;
-use BookStack\Exceptions\PrettyException;
 use Illuminate\Contracts\Auth\Authenticatable;
 use Illuminate\Http\Request;
 use BookStack\Exceptions\SocialSignInException;
@@ -36,7 +33,6 @@ class AuthController extends Controller
     protected $redirectAfterLogout = '/login';
     protected $username = 'email';
 
-
     protected $socialAuthService;
     protected $emailConfirmationService;
     protected $userRepo;
@@ -53,6 +49,8 @@ class AuthController extends Controller
         $this->socialAuthService = $socialAuthService;
         $this->emailConfirmationService = $emailConfirmationService;
         $this->userRepo = $userRepo;
+        $this->redirectPath = baseUrl('/');
+        $this->redirectAfterLogout = baseUrl('/login');
         $this->username = config('auth.method') === 'standard' ? 'email' : 'username';
         parent::__construct();
     }
@@ -194,14 +192,11 @@ class AuthController extends Controller
         }
 
         if (setting('registration-confirmation') || setting('registration-restrict')) {
-            $newUser->email_confirmed = false;
             $newUser->save();
             $this->emailConfirmationService->sendConfirmation($newUser);
             return redirect('/register/confirm');
         }
 
-        $newUser->email_confirmed = true;
-
         auth()->login($newUser);
         session()->flash('success', 'Thanks for signing up! You are now registered and signed in.');
         return redirect($this->redirectPath());