Skip to content

Commit

Permalink
Update LoginService.php (#271)
Browse files Browse the repository at this point in the history
* Update LoginService.php

Resolve :  Issue : password create in nextcloud database for OpenId connect users #207

* Update LoginService.php

correction of the comment of the previous modification

* Update LoginService.php

change double quotes by simple quotes (related to the previous commit lint job)
  • Loading branch information
mathsyx69 authored Mar 31, 2024
1 parent ee5563c commit ccc4541
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Service/LoginService.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ public function login(array $profile): array

// Create user if not existing
if (null === $user) {
// Generate random password of 30 characters
$password = substr(base64_encode(random_bytes(64)), 0, 30);
// Generate random password of 32 characters that meets nextcloud's strictest password policy
$randomPassword = substr(base64_encode(random_bytes(64)), 0, 28);
$password = 'aA'.$randomPassword.'1$';

// Create user. This will throw if creation is not permitted.
$user = $this->createUser($uid, $password);
Expand Down

0 comments on commit ccc4541

Please sign in to comment.