Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization of 'Closure' is not allowed #28

Closed
bettinz opened this issue Jul 28, 2021 · 0 comments · Fixed by #29
Closed

Serialization of 'Closure' is not allowed #28

bettinz opened this issue Jul 28, 2021 · 0 comments · Fixed by #29

Comments

@bettinz
Copy link

bettinz commented Jul 28, 2021

Hello, as I wrote here: knpuniversity/oauth2-client-bundle#326

using the apple login with this bundle I have this server error:

Serialization of 'Closure' is not allowed
The error is triggered from

/vendor/symfony/security-guard/Authenticator/GuardBridgeAuthenticator.php in serialize at line 78

        throw new \UnexpectedValueException(sprintf('The return value of "%1$s::getCredentials()" must not be null. Return false from "%1$s::supports()" instead.', get_debug_type($this->guard)));
        }
        // get the user from the GuardAuthenticator
        if (class_exists(UserBadge::class)) {
            $user = new UserBadge('guard_authenticator_'.md5(serialize($credentials)), function () use ($credentials) { return $this->getUser($credentials); });
        } else {
            // BC with symfony/security-http:5.1
            $user = $this->getUser($credentials);
        }

The line is:

$user = new UserBadge('guard_authenticator_'.md5(serialize($credentials)), function () use ($credentials) { return $this->getUser($credentials); });

Can you help me to understand what is wrong? I'm using sf 5.3 with new authenticator system

enable_authenticator_manager: true

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant