cross-solution / YAWIK

YAWIK is a web application. It can be used as an ATS applicant tracking system or as a jobboard.
https://yawik.org
MIT License
126 stars 67 forks source link

login via "GitHub" or "Google" in the demo seems to be broken. #257

Closed cbleek closed 8 years ago

cbleek commented 8 years ago

Error Message: No adapter registered for key google in the adapter map.

2016-08-02 16:23:18 EXCEPTION No adapter registered for key google in the adapter map. in /home/cbleek/Projects/YAWIK/module/Auth/src/Auth/Controller/Plugin/SocialProfiles.php on line 80
[Trace]
        File: /home/cbleek/Projects/YAWIK/module/Auth/src/Auth/Controller/Plugin/SocialProfiles.php
        Line: 43
    Function: getAdapter
       Class: Auth\Controller\Plugin\SocialProfiles
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/module/Auth/src/Auth/Adapter/HybridAuth.php
        Line: 110
    Function: fetch
       Class: Auth\Controller\Plugin\SocialProfiles
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-authentication/src/AuthenticationService.php
        Line: 110
    Function: authenticate
       Class: Auth\Adapter\HybridAuth
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/module/Auth/src/Auth/AuthenticationService.php
        Line: 82
    Function: authenticate
       Class: Zend\Authentication\AuthenticationService
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/module/Auth/src/Auth/Controller/IndexController.php
        Line: 201
    Function: authenticate
       Class: Auth\AuthenticationService
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php
        Line: 82
    Function: loginAction
       Class: Auth\Controller\IndexController
        Type: method
------------------------------
    Function: onDispatch
       Class: Zend\Mvc\Controller\AbstractActionController
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-eventmanager/src/EventManager.php
        Line: 490
    Function: call_user_func
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-eventmanager/src/EventManager.php
        Line: 214
    Function: triggerListeners
       Class: Zend\EventManager\EventManager
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php
        Line: 118
    Function: trigger
       Class: Zend\EventManager\EventManager
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-mvc/src/DispatchListener.php
        Line: 93
    Function: dispatch
       Class: Zend\Mvc\Controller\AbstractController
        Type: method
------------------------------
    Function: onDispatch
       Class: Zend\Mvc\DispatchListener
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-eventmanager/src/EventManager.php
        Line: 490
    Function: call_user_func
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-eventmanager/src/EventManager.php
        Line: 214
    Function: triggerListeners
       Class: Zend\EventManager\EventManager
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/vendor/zendframework/zend-mvc/src/Application.php
        Line: 314
    Function: trigger
       Class: Zend\EventManager\EventManager
        Type: method
------------------------------
        File: /home/cbleek/Projects/YAWIK/public/index.php
        Line: 49
    Function: run
       Class: Zend\Mvc\Application
        Type: method
------------------------------
cbleek commented 8 years ago

The bug was introduced in 99270f8

cbleek commented 8 years ago

@fedys : before this commit, it was possible to login with google and github. Can you take a look at this?

TiSiE commented 8 years ago

I'm not sure, if we need the social profiles plugin for this feature. Using just the user profile provided by HybridAuth is sufficient. The former are really only needed if someone wants to attach the profile to an application (or CV) and will be fetched then again anyway.

Otherwise, we'd have to implement a Social PRofiles Adapter for EVERY login service, even this service should NOT be attached to applications... That is very limiting, if a new service arises, and cannot be used in YAWIK, because we have not yet implement an adapter.

fedys commented 8 years ago

@TiSiE you are right

fedys commented 8 years ago

@cbleek I am working on it.

fedys commented 8 years ago

There are two possible solutions:

  1. To catch \InvalidArgumentException on the following line and in such case leave the profile data empty. No other changes are needed.
  2. To get rid off the SocialProfilePlugin dependency in the HybridAuth and change a logic of showing profile info on the page /en/my/profile . This involves changes in the social profiles form when an user clicks the "view profile data" link with profile data not yet populated. In such case the SocialProfilePlugin has to be called and populate the data accordingly.

Which solution do you prefer?

TiSiE commented 8 years ago

Implement the first solution, to quickly fix the error for v0.26.

The feature was implemented reusing the SocialProfiles form, but as we now see, this was the wrong approach. Because attaching a profile to an application/cv and attaching a profile to a user are two completely different things. But we will address the needed rework in a new issue (for v0.27 or later).