Problem/Motivation
When using the social_auth_facebook module, I have encountered an error when attempting to cancel the authentication process. The module works perfectly when I click the "Continue as [NAME]" button, but when I click the cancel button, Drupal throws an error.
Steps to reproduce
Install and configure the social_auth_facebook module.
Navigate to the login page or any page that utilizes the module's functionality.
Click the "Cancel" button during the authentication process.
Actual Behavior
Upon clicking the "Cancel" button, Drupal throws the following error:
NOTICE: PHP message: TypeError: League\OAuth2\Client\Provider\AbstractProvider::getResourceOwner(): Argument #1 ($token) must be of type League\OAuth2\Client\Token\AccessToken, null given, called in /app/web/modules/contrib/social_auth_facebook/src/FacebookAuthManager.php on line 65 in /app/vendor/league/oauth2-client/src/Provider/AbstractProvider.php on line 863 #0 /app/web/modules/contrib/social_auth_facebook/src/FacebookAuthManager.php(65):
Additional Notes
This issue affects the user experience, as users who attempt to cancel the authentication process encounter an error and are unable to proceed. It disrupts the expected flow of the module and may cause confusion or frustration among users.
The issue occurs consistently when canceling the authentication process.
The error message references a TypeError related to the getResourceOwner() method in AbstractProvider.php.
Line 65 in FacebookAuthManager.php is mentioned as the point of invocation.
Issue fork social_auth_facebook-3367565
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
garethhallnz commentedComment #4
garethhallnz commentedComment #5
wellsLooks good. Thanks for contributing!
I think this same pattern should be used across all implementers (I just did something similar for Social Auth PBS) so while I'm happy to merge this to improve the current situation ideally we eventually make a change for this upstream in the Social Auth module itself.
Comment #7
wells