passkey existing
This commit is contained in:
@@ -315,6 +315,21 @@ func TestPublicRegistrationCannotAttachCredentialsToExistingUser(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCurrentUserCanBeginPasskeyRegistrationForExistingAccount(t *testing.T) {
|
||||
service := setupAuthTestService(t)
|
||||
ctx := context.Background()
|
||||
|
||||
user := setupInitialAdmin(t, service, false)
|
||||
principal := principalFromUser(user, "session", "sess:test", "", nil, time.Now().Add(time.Hour))
|
||||
options, challengeID, err := service.BeginCurrentUserPasskeyRegistration(ctx, principal)
|
||||
if err != nil {
|
||||
t.Fatalf("BeginCurrentUserPasskeyRegistration() error = %v", err)
|
||||
}
|
||||
if options == nil || challengeID == "" {
|
||||
t.Fatalf("options = %#v, challengeID = %q; want registration options and challenge", options, challengeID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInitialSetupCanDisablePublicRegistration(t *testing.T) {
|
||||
service := setupAuthTestService(t)
|
||||
ctx := context.Background()
|
||||
|
||||
Reference in New Issue
Block a user