diff --git a/src/routes/social.php b/src/routes/social.php index 2c7ab27..b12ca7e 100644 --- a/src/routes/social.php +++ b/src/routes/social.php @@ -1,28 +1,38 @@ - ['web', 'guest'], 'prefix' => config('socials.admin_prefix')], function () use ($routes) { - - Route::get($routes['auth_login'][0], [LoginController::class, 'redirectToProvider']) - ->name($routes['auth_login'][1]); - - Route::get($routes['auth_login_callback'][0], [LoginController::class, 'handleProviderCallback']) - ->name($routes['auth_login_callback'][1]); - - Route::get($routes['auth_login_form'][0], [AuthController::class, 'showLoginForm']) - ->name($routes['auth_login_form'][1]); - - Route::post($routes['auth_login_form_callback'][0], [AuthController::class, 'login']) - ->name($routes['auth_login_form_callback'][1]); -}); - -Route::group(['middleware' => ['web', 'auth']], function () use ($routes) { - - Route::post($routes['social_logout'][0], [LoginController::class, 'logout']) - ->name($routes['social_logout'][1]); -}); + ['web', 'guest'], 'prefix' => config('socials.admin_prefix')], function () use ($routes) { + + if (isset($routes['auth_login'])) { + Route::get($routes['auth_login'][0], [LoginController::class, 'redirectToProvider']) + ->name($routes['auth_login'][1]); + } + + if (isset($routes['auth_login_callback'])) { + Route::get($routes['auth_login_callback'][0], [LoginController::class, 'handleProviderCallback']) + ->name($routes['auth_login_callback'][1]); + } + + if (isset($routes['auth_login_form'])) { + Route::get($routes['auth_login_form'][0], [AuthController::class, 'showLoginForm']) + ->name($routes['auth_login_form'][1]); + } + + if (isset($routes['auth_login_form_callback'])) { + Route::post($routes['auth_login_form_callback'][0], [AuthController::class, 'login']) + ->name($routes['auth_login_form_callback'][1]); + } +}); + +Route::group(['middleware' => ['web', 'auth']], function () use ($routes) { + + if (isset($routes['social_logout'])) { + Route::post($routes['social_logout'][0], [LoginController::class, 'logout']) + ->name($routes['social_logout'][1]); + } +}); \ No newline at end of file