mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 19:13:26 +00:00
update API
revert bad merge fix cs
This commit is contained in:
@@ -168,19 +168,6 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
return $this->usr_id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $secret
|
||||
* @param string $nonce
|
||||
* @return string
|
||||
*/
|
||||
protected static function crypt_secret($secret, $nonce)
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
|
||||
return hash_hmac('sha512', $secret . $nonce, $registry->get('GV_sit'));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Implements OAuth2::checkClientCredentials().
|
||||
@@ -198,9 +185,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
return true;
|
||||
}
|
||||
|
||||
$crypted = $this->crypt_secret($client_secret, $application->get_nonce());
|
||||
|
||||
return ($result["client_secret"] === $crypted);
|
||||
return ($application->get_client_secret() === $client_secret);
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user