Skip to content

Commit c403d05

Browse files
committed
Fixed social login routes
Fixes #239
1 parent 0fb1fc8 commit c403d05

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/Http/Controllers/Auth/LoginController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace BookStack\Http\Controllers\Auth;
44

5+
use BookStack\Exceptions\AuthException;
56
use BookStack\Http\Controllers\Controller;
67
use BookStack\Repos\UserRepo;
78
use BookStack\Services\SocialAuthService;

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class RegisterController extends Controller
5151
*/
5252
public function __construct(SocialAuthService $socialAuthService, EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
5353
{
54-
$this->middleware('guest');
54+
$this->middleware('guest')->except(['socialCallback', 'detachSocialAccount']);
5555
$this->socialAuthService = $socialAuthService;
5656
$this->emailConfirmationService = $emailConfirmationService;
5757
$this->userRepo = $userRepo;
@@ -297,5 +297,4 @@ protected function socialRegisterCallback($socialDriver)
297297
return $this->registerUser($userData, $socialAccount);
298298
}
299299

300-
301300
}

routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
});
154154

155155
// Social auth routes
156-
Route::get('/login/service/{socialDriver}', 'Auth\RegisterController@getSocialLogin');
156+
Route::get('/login/service/{socialDriver}', 'Auth\LoginController@getSocialLogin');
157157
Route::get('/login/service/{socialDriver}/callback', 'Auth\RegisterController@socialCallback');
158158
Route::get('/login/service/{socialDriver}/detach', 'Auth\RegisterController@detachSocialAccount');
159159
Route::get('/register/service/{socialDriver}', 'Auth\RegisterController@socialRegister');

0 commit comments

Comments
 (0)