PHP code example of xervice / github-oauth

1. Go to this page and download the library: Download xervice/github-oauth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xervice / github-oauth example snippets


$this->addRoute(GithubAuthConfig::LOGIN_PATH, GithubController::class, 'githubLoginAction', ['GET']);
$this->addRoute(GithubAuthConfig::AUTH_PATH, GithubController::class, 'githubAuthAction', ['GET']);
$this->addRoute(GithubAuthConfig::ERROR_PATH, GithubController::class, 'githubError', ['GET']);

protected function addRoute(string $path, string $controller, string $action, array $methods);