Skip to content

Commit

Permalink
Fix Authentik Account Registration (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
CocoPoops authored Jun 14, 2024
1 parent e969601 commit 2e9b04c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Security/AuthentikAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ public function authenticate(Request $request): Passport
throw new CustomUserMessageAuthenticationException('MBIN_SSO_REGISTRATIONS_ENABLED');
}

$email = $authentikUser->toArray()['preferred_username'];
$username = $slugger->slug(substr($email, 0, strrpos($email, '@')));
$username = $slugger->slug($authentikUser->toArray()['preferred_username']);

if ($this->userRepository->count(['username' => $username]) > 0) {
$username .= rand(1, 999);
Expand Down

0 comments on commit 2e9b04c

Please sign in to comment.