Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
42a3acc2
Commit
42a3acc2
authored
Jun 21, 2018
by
Sietse Ringers
Browse files
When receiving a singleton credential, correctly detect and remove existing credential instance
parent
9fcc666b
Changes
1
Hide whitespace changes
Inline
Side-by-side
irmaclient/client.go
View file @
42a3acc2
...
...
@@ -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
.
cred
s
(
id
))
>
0
{
if
!
id
.
Empty
()
&&
cred
.
CredentialType
()
.
IsSingleton
&&
len
(
client
.
attr
s
(
id
))
>
0
{
client
.
remove
(
id
,
0
,
false
)
// Index is 0, because if we're here we have exactly one
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment