Skip to content

Commit ee16236

Browse files
committed
simplify user entity defaults
1 parent e81d160 commit ee16236

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/PasskeyAuthenticatable.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,21 @@ public function hasPasskeysEnabled(): bool
3939
*/
4040
public function getPasskeyUserHandle(): string
4141
{
42-
if (isset($this->passkey_user_handle) && ! empty($this->passkey_user_handle)) {
43-
return $this->passkey_user_handle;
44-
}
45-
4642
return (string) $this->getKey();
4743
}
4844

4945
/**
5046
* Get the display name for WebAuthn registration.
47+
* Shown in the authenticator UI as a human-friendly name.
5148
*/
5249
public function getPasskeyDisplayName(): string
5350
{
54-
return $this->name ?? $this->email;
51+
return $this->email;
5552
}
5653

5754
/**
5855
* Get the username for WebAuthn registration.
56+
* Used as the account identifier in the authenticator UI.
5957
*/
6058
public function getPasskeyUsername(): string
6159
{

tests/Feature/Actions/GenerateRegistrationOptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
expect($options)->toBeInstanceOf(PublicKeyCredentialCreationOptions::class);
1616
expect($options->user->name)->toBe('john@example.com');
17-
expect($options->user->displayName)->toBe('John Doe');
17+
expect($options->user->displayName)->toBe('john@example.com');
1818
});
1919

2020
it('excludes existing credentials from registration', function () {

0 commit comments

Comments
 (0)