SocialiteProviders / Providers

A Collection of Providers for Laravel Socialite
https://socialiteproviders.com
MIT License
499 stars 438 forks source link

PKCE crashes when using stateless #1163

Open srabouin opened 7 months ago

srabouin commented 7 months ago

Using PKCE will crash when using stateless since it accesses session() but there is no session.

I would do something like this, which solves the problem in AbstractProvider.php

        if ($this->usesPKCE()) {
                if($this->isStateless()) {
                        $fields['code_verifier'] = $this->request->get('code_verifier');
                } else {
                        $fields['code_verifier'] = $this->request->session()->pull('code_verifier');
                }
        }

This is probably an edge case, but I am using a frontend to do the first part of the authentication and just the last part is done by the backend. (nuxt auth)