Make redirect
& callback
public instead of private
as required by Laravel 12 (#1081)
This commit is contained in:
parent
fd6e7eb314
commit
9aaf6b3798
@ -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()) {
|
||||
|
@ -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');
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user