Social Auth Zalo allows users login to Drupal site with their Zalo account. The module request Id and Name in Zalo API for authenticate user.

This module adds a path: user/login/zalo this path will redirect user to Zalo login page.

After Zalo return the user back to website, the module use Zalo SDK to request Access Token then get the user's Id, Name from Zalo API.

Installation

Dependencies

Please use modules version below for social_auth_zalo:8.x-2.x:

Zalo App

Project link

https://www.drupal.org/project/social_auth_zalo

Git intructions

git clone --branch 8.x-2.x https://git.drupalcode.org/project/social_auth_zalo.git

PAReview checklist

https://pareview.sh/pareview/https-git.drupal.org-project-social_auth_za...

CommentFileSizeAuthor
#8 drupal-check.png145.87 KBphthlaap
#6 phpstan.png284.91 KBphthlaap

Comments

phthlaap created an issue. See original summary.

vuil’s picture

Issue summary: View changes
vuil’s picture

Status: Needs review » Needs work

Hello,
Thank you for the contribution!

Please fix the following issues:
(1.) Make the default Git branch to be '8.x-2.x'.

(2.) Please fix the following issues:

 ------ ----------------------------------------------------------------------
  Line   src\Controller\ZaloAuthController.php
 ------ ----------------------------------------------------------------------
  119    Call to deprecated function drupal_set_message():
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  141    Call to deprecated function drupal_set_message():
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  150    Call to deprecated function drupal_set_message():
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  157    Call to deprecated function drupal_set_message():
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  162    Call to deprecated function drupal_set_message():
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
  167    Call to deprecated function drupal_set_message():
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
 ------ ----------------------------------------------------------------------
 [ERROR] Found 6 errors
phthlaap’s picture

Status: Needs work » Needs review

Hi,

Thank you for your support. I changed default Git branch to 8x-2.x (1), also fixed the issues (2).
Please help to review again.

Thanks,

vuil’s picture

Status: Needs review » Needs work

Thank you for the good work!

There are additional issues which you need to fix them:

 ------ ----------------------------------------------------------------------------------
  Line   src\Controller\ZaloAuthController.php
 ------ ----------------------------------------------------------------------------------
  35     Property Drupal\social_auth_zalo\Controller\ZaloAuthController::$userManager has unknown class
         Drupal\social_api\User\UserManagerInterface as its type.
  42     Property Drupal\social_auth_zalo\Controller\ZaloAuthController::$userAuthenticator has unknown class
         Drupal\social_auth\User\UserAuthenticator as its type.
  91     Parameter $user_manager of method Drupal\social_auth_zalo\Controller\ZaloAuthController::__construct() has
         invalid typehint type Drupal\social_api\User\UserManagerInterface.
  95     Parameter $user_authenticator of method Drupal\social_auth_zalo\Controller\ZaloAuthController::__construct()
         has invalid typehint type Drupal\social_auth\User\UserAuthenticator.
 ------ ----------------------------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------
  Line   src\Plugin\Network\ZaloAuth.php
 ------ ----------------------------------------------------------------------------------
  115    Return typehint of method Drupal\social_auth_zalo\Plugin\Network\ZaloAuth::initSdk() has invalid type
         Zalo\Zalo.
  130    Instantiated class Zalo\Zalo not found.
 ------ ----------------------------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------
  Line   src\ZaloAuthManager.php
 ------ ----------------------------------------------------------------------------------
  60     Property Drupal\social_auth_zalo\ZaloAuthManager::$client has unknown class Zalo\Zalo as its type.
  78     Drupal\social_auth_zalo\ZaloAuthManager::__construct() calls parent constructor but parent does not have one.
  79     Call to an undefined static method Drupal\social_auth\AuthManager\OAuth2Manager::__construct().
  114    Caught class Zalo\Exceptions\ZaloResponseException not found.
  120    Caught class Zalo\Exceptions\ZaloSDKException not found.
  164    Access to constant API_GRAPH_ME on an unknown class Zalo\ZaloEndPoint.
  167    Caught class Zalo\Exceptions\ZaloResponseException not found.
  172    Caught class Zalo\Exceptions\ZaloSDKException not found.
 ------ ----------------------------------------------------------------------------------

 [ERROR] Found 14 errors
phthlaap’s picture

StatusFileSize
new284.91 KB

Hi @ilchovuchkov,

Thank you for your review. Is it report by phpstan?
Could you please help to share with me how to config it?
Because When I install and run it show only one issue, please see my screenshot

Thanks,

vuil’s picture

@phthlaap Yes, you are right.

This is additional product based on PHPStan:
mglaman/drupal-check - CLI tool for running checks on a Drupal code base
https://github.com/mglaman/drupal-check

Please use after install: composer --global require mglaman/drupal-check
in your project root: drupal-check -ad web/modules/social_auth_zalo
(to test your project/module folder)

I hope this will be helpful for many of us. :)
Thank you.

Read more.

phthlaap’s picture

StatusFileSize
new145.87 KB

Hi @ilchovuchkov,

is there any problem in my local? :)
It shown No errors.
drupal-check.png

vuil’s picture

Status: Needs work » Reviewed & tested by the community

Thank you for the contribution!

I have not found any security related issues into the code.

phthlaap’s picture

Hi @ilchovuchkov,

Thank you for your support. I'm looking forward my modules can release with "Drupal.org Security Advisory Coverage" logo.

I have learned much with this work.

phthlaap’s picture

Hi,

Could you please let me know or suggest me the next step of this issue. I spend time to much and all of my mind for that. I look forward it approved.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

phthlaap’s picture

Thanks @kiamlaluno for your support.

I will read that document you suggest. This issue is fixed so can I open the "closed (dublicate)" issue to review again.

avpaderno’s picture

There isn't any need to re-open it, since you can opt into security coverage for any project you created (and you will create).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.