Avoid ISecureRandom::CHAR_HUMAN_READABLE to retain compatibility with

ownCloud and Nextcloud < 12.0.0
This commit is contained in:
Pellaeon Lin 2017-08-16 01:37:48 +08:00
parent 561e4bd6ae
commit 01fa314fc5
1 changed files with 3 additions and 2 deletions

View File

@ -93,8 +93,9 @@ class RegistrationMapper extends Mapper {
* @param Registration $registration
*/
public function generateClientSecret(Registration &$registration) {
$token = $this->random->generate(32, ISecureRandom::CHAR_HUMAN_READABLE);
$token = $this->random->generate(32, "abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789");
//FIXME eqivalent to ISecureRandom::CHAR_HUMAN_READABLE introduced in https://github.com/nextcloud/server/commit/f2a2b34e4639e88f8d948a388a51f010212b42a3 but not supported in ownCloud yet. We'll just use the string for now then switch to constants when supported.
$registration->setClientSecret($token);
}
}
}