Make redirect & callback public instead of private as required by Laravel 12 (#1081)

This commit is contained in:
MartinOscar 2025-03-12 19:32:16 +01:00 committed by GitHub
parent fd6e7eb314
commit 9aaf6b3798
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -24,7 +24,7 @@ class OAuthController extends Controller
/**
* Redirect user to the OAuth provider
*/
protected function redirect(string $driver): RedirectResponse
public function redirect(string $driver): RedirectResponse
{
// Driver is disabled - redirect to normal login
if (!OAuthProvider::get($driver)->isEnabled()) {
@ -37,7 +37,7 @@ class OAuthController extends Controller
/**
* Callback from OAuth provider.
*/
protected function callback(Request $request, string $driver): RedirectResponse
public function callback(Request $request, string $driver): RedirectResponse
{
// Driver is disabled - redirect to normal login
if (!OAuthProvider::get($driver)->isEnabled()) {

View File

@ -1,9 +1,11 @@
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Auth;
use App\Http\Controllers\Auth\OAuthController;
Route::redirect('/login', '/login')->name('auth.login');
Route::get('/oauth/redirect/{driver}', [Auth\OAuthController::class, 'redirect'])->name('auth.oauth.redirect');
Route::get('/oauth/callback/{driver}', [Auth\OAuthController::class, 'callback'])->name('auth.oauth.callback')->withoutMiddleware('guest');
Route::prefix('oauth')->group(function () {
Route::get('/redirect/{driver}', [OAuthController::class, 'redirect'])->name('auth.oauth.redirect');
Route::get('/callback/{driver}', [OAuthController::class, 'callback'])->name('auth.oauth.callback')->withoutMiddleware('guest');
});