Error occurs when canceling authentication with social_auth_facebook module

Created on 19 June 2023, over 1 year ago
Updated 21 June 2023, over 1 year ago

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.

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand garethhallnz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024