mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 18:18:18 +01:00
Enhance OAuth module to store the stripe account in llx_oauth_token
This commit is contained in:
@@ -109,7 +109,7 @@ if (! empty($_GET['code'])) // We are coming from oauth provider page
|
||||
// We should have
|
||||
//$_GET=array('code' => string 'aaaaaaaaaaaaaa' (length=20), 'state' => string 'user,public_repo' (length=16))
|
||||
|
||||
dol_syslog("We are coming fr mthe oauth provider page");
|
||||
dol_syslog("We are coming from the oauth provider page");
|
||||
//llxHeader('',$langs->trans("OAuthSetup"));
|
||||
|
||||
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
@@ -125,14 +125,14 @@ if (! empty($_GET['code'])) // We are coming from oauth provider page
|
||||
//var_dump($_GET['code']);
|
||||
//var_dump($state);
|
||||
//var_dump($apiService); // OAuth\OAuth2\Service\GitHub
|
||||
|
||||
|
||||
//$token = $apiService->requestAccessToken($_GET['code'], $state);
|
||||
$token = $apiService->requestAccessToken($_GET['code']);
|
||||
// Github is a service that does not need state to be stored.
|
||||
// Into constructor of GitHub, the call
|
||||
// parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri)
|
||||
// has not the ending parameter to true like the Google class constructor.
|
||||
|
||||
|
||||
setEventMessages($langs->trans('NewTokenStored'), null, 'mesgs'); // Stored into object managed by class DoliStorage so into table oauth_token
|
||||
|
||||
$backtourl = $_SESSION["backtourlsavedbeforeoauthjump"];
|
||||
|
||||
Reference in New Issue
Block a user