Commit 42a3acc2 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

When receiving a singleton credential, correctly detect and remove existing credential instance

parent 9fcc666b
......@@ -224,7 +224,7 @@ func (client *Client) addCredential(cred *credential, storeAttributes bool) (err
// If this is a singleton credential type, ensure we have at most one by removing any previous instance
if !id.Empty() && cred.CredentialType().IsSingleton && len(client.creds(id)) > 0 {
if !id.Empty() && cred.CredentialType().IsSingleton && len(client.attrs(id)) > 0 {
client.remove(id, 0, false) // Index is 0, because if we're here we have exactly one
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment