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

Refactoring code for simplification and interoperability #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bircher
Copy link

@bircher bircher commented Feb 20, 2018

I refactored the code to use only one form and most importantly I refactored the Account manager to work with the code from the frontend as submitted through the form rather than intercepting any request with a "code" argument.

otarza and others added 5 commits October 7, 2017 00:37
The login needs to happen on form submit to be compatible with the simple_fb_connect module and
other modules that use "code" in a request. Account kit does not really provide an authentication
mechanism other than the form with the javascript anyway.
@otarza otarza self-assigned this Feb 20, 2018
@otarza
Copy link
Owner

otarza commented Feb 20, 2018

Hi @bircher,

Thanks for the PR, I'll just test tomorrow and merge it.

@otarza
Copy link
Owner

otarza commented Mar 3, 2018

@bircher I tried to test this on Drupal 8.4.5 but was unable to login. Got following errors:

Notice: Undefined index: access_token in Drupal\accountkit\AccountKitManager->getAccessToken() (line 112 of modules/custom/accountkit/src/AccountKitManager.php).

Notice: Undefined variable: user in Drupal\accountkit\AccountKitManager->userLoginFromCode() (line 56 of modules/custom/accountkit/src/AccountKitManager.php).

Notice: Undefined variable: user_name in Drupal\accountkit\AccountKitManager->userLoginFromCode() (line 59 of modules/custom/accountkit/src/AccountKitManager.php).

Notice: Undefined variable: user in Drupal\accountkit\AccountKitManager->userLoginFromCode() (line 71 of modules/custom/accountkit/src/AccountKitManager.php).

Also I found following errors in logs:
The access token was empty.
Error verifying the token in the 'access_token' type: OAuthException code: 190 fbtrace_id:BaeFucWKY9+

Maybe I'm missing something?

@bircher
Copy link
Author

bircher commented Mar 6, 2018

Hi @otarza I injected the externalauth and guzzle client services so that we don't need to call any drupal functions any more and that we can in the future unit test the manager service without making a request to facebook.

Also with the new exceptions it may be easier to debug what is going on.
And you will want to test it with Drupal 8.5 where forms have the messenger service so that we don't have to call drupal_set_message.

This was referenced Mar 12, 2018
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 this pull request may close these issues.

2 participants