mariovalney/laravel-keycloak-web-guard

Call to undefined method Vizir\KeycloakWebGuard\Auth\Guard\KeycloakWebGuard::viaRemember()

hatavoo opened this issue · 2 comments

hello.

I use Laravel8 and jetstream.
I'm trying to redirect to the dashboard , which is a secure page, after logging in with keycloak.

This is my route setting.

Route::group(['middleware' => 'keycloak-web'], function () {
    Route::get('/dashboard', function () {
        return view('dashboard');
    })->name('dashboard');
});
Route::get('/login', [\Vizir\KeycloakWebGuard\Controllers\AuthController::class, 'login'])->name('keycloak.login');
Route::get('/callback', [\Vizir\KeycloakWebGuard\Controllers\AuthController::class, 'callback'])->name('keycloak.callback');
Route::post('/logout', [\Vizir\KeycloakWebGuard\Controllers\AuthController::class, 'logout'])->name('keycloak.logout');

The callback method is working properly.

Call to undefined method Vizir\KeycloakWebGuard\Auth\Guard\KeycloakWebGuard::viaRemember()
vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php:42

How is it correct to resolve this error?
I added this to the KeycloakWebGuard.php

    public function viaRemember()
    {
        return false;
    }

Thank you.

Hi!

Maybe you are including "AuthenticateSession" Middleware in request?
It's not necessary and will throw this error.

You can check our example.

I created a PR to fix, but I'm not sure we should do it.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.