Move Google authentication to an external plugin

This commit is contained in:
Frederic Guillot
2016-01-29 20:15:53 -05:00
parent 915bf58822
commit dae0c7391a
39 changed files with 41 additions and 574 deletions

View File

@@ -10,16 +10,6 @@ namespace Kanboard\Controller;
*/
class Oauth extends Base
{
/**
* Link or authenticate a Google account
*
* @access public
*/
public function google()
{
$this->step1('Google');
}
/**
* Link or authenticate a Github account
*
@@ -65,7 +55,7 @@ class Oauth extends Base
* @access private
* @param string $provider
*/
private function step1($provider)
protected function step1($provider)
{
$code = $this->request->getStringParam('code');
@@ -79,11 +69,11 @@ class Oauth extends Base
/**
* Link or authenticate the user
*
* @access private
* @access protected
* @param string $provider
* @param string $code
*/
private function step2($provider, $code)
protected function step2($provider, $code)
{
$this->authenticationManager->getProvider($provider)->setCode($code);
@@ -97,10 +87,10 @@ class Oauth extends Base
/**
* Link the account
*
* @access private
* @access protected
* @param string $provider
*/
private function link($provider)
protected function link($provider)
{
$authProvider = $this->authenticationManager->getProvider($provider);
@@ -117,10 +107,10 @@ class Oauth extends Base
/**
* Authenticate the account
*
* @access private
* @access protected
* @param string $provider
*/
private function authenticate($provider)
protected function authenticate($provider)
{
if ($this->authenticationManager->oauthAuthentication($provider)) {
$this->response->redirect($this->helper->url->to('app', 'index'));