X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/7ad8314bd71adef5336ed6482e6933d02805f26a..refs/pull/1695/head:/app/Http/Controllers/Auth/LoginController.php diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index c0541c9e2..c739fd9a3 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,11 +2,11 @@ namespace BookStack\Http\Controllers\Auth; +use BookStack\Auth\Access\LdapService; +use BookStack\Auth\Access\SocialAuthService; +use BookStack\Auth\UserRepo; use BookStack\Exceptions\AuthException; use BookStack\Http\Controllers\Controller; -use BookStack\Repos\UserRepo; -use BookStack\Services\LdapService; -use BookStack\Services\SocialAuthService; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; @@ -43,9 +43,9 @@ class LoginController extends Controller /** * Create a new controller instance. * - * @param SocialAuthService $socialAuthService + * @param \BookStack\Auth\\BookStack\Auth\Access\SocialAuthService $socialAuthService * @param LdapService $ldapService - * @param UserRepo $userRepo + * @param \BookStack\Auth\UserRepo $userRepo */ public function __construct(SocialAuthService $socialAuthService, LdapService $ldapService, UserRepo $userRepo) { @@ -53,8 +53,8 @@ class LoginController extends Controller $this->socialAuthService = $socialAuthService; $this->ldapService = $ldapService; $this->userRepo = $userRepo; - $this->redirectPath = baseUrl('/'); - $this->redirectAfterLogout = baseUrl('/login'); + $this->redirectPath = url('/'); + $this->redirectAfterLogout = url('/https/source.bookstackapp.com/login'); parent::__construct(); } @@ -106,9 +106,7 @@ class LoginController extends Controller $this->ldapService->syncGroups($user, $request->get($this->username())); } - $path = session()->pull('url.intended', '/'); - $path = baseUrl($path, true); - return redirect($path); + return redirect()->intended('/'); } /** @@ -128,7 +126,7 @@ class LoginController extends Controller ]); } - return view('auth/login', ['socialDrivers' => $socialDrivers, 'authMethod' => $authMethod]); + return view('auth.login', ['socialDrivers' => $socialDrivers, 'authMethod' => $authMethod]); } /**