Fixed social login routes

Fixes #239
This commit is contained in:
Dan Brown 2016-11-27 19:11:15 +00:00
parent 0fb1fc87c8
commit c403d05755
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 3 additions and 3 deletions

View File

@ -2,6 +2,7 @@
namespace BookStack\Http\Controllers\Auth;
use BookStack\Exceptions\AuthException;
use BookStack\Http\Controllers\Controller;
use BookStack\Repos\UserRepo;
use BookStack\Services\SocialAuthService;

View File

@ -51,7 +51,7 @@ class RegisterController extends Controller
*/
public function __construct(SocialAuthService $socialAuthService, EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
{
$this->middleware('guest');
$this->middleware('guest')->except(['socialCallback', 'detachSocialAccount']);
$this->socialAuthService = $socialAuthService;
$this->emailConfirmationService = $emailConfirmationService;
$this->userRepo = $userRepo;
@ -297,5 +297,4 @@ class RegisterController extends Controller
return $this->registerUser($userData, $socialAccount);
}
}

View File

@ -153,7 +153,7 @@ Route::group(['middleware' => 'auth'], function () {
});
// Social auth routes
Route::get('/login/service/{socialDriver}', 'Auth\RegisterController@getSocialLogin');
Route::get('/login/service/{socialDriver}', 'Auth\LoginController@getSocialLogin');
Route::get('/login/service/{socialDriver}/callback', 'Auth\RegisterController@socialCallback');
Route::get('/login/service/{socialDriver}/detach', 'Auth\RegisterController@detachSocialAccount');
Route::get('/register/service/{socialDriver}', 'Auth\RegisterController@socialRegister');