Skip to content

Commit

Permalink
fix: Fido2 enrollment cancelling #143
Browse files Browse the repository at this point in the history
  • Loading branch information
maduvena committed Sep 28, 2021
1 parent e2e443f commit a4ad06b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void add() {

@NotifyChange({ "uiEnrolled", "uiEnrolledPlatformAuthenticator", "newDevice", "newTouchId" })
public void cancel() {
logger.info("cancel invoked");

boolean success = false;
try {
/*
Expand All @@ -306,10 +306,12 @@ public void cancel() {
* pressing cancel), we need to be obliterate the entry
*/
FidoDevice dev = null;
if (platformAuthenticator && Utils.isNotEmpty(newTouchId.getNickName())) {
if (platformAuthenticator && Utils.isNotEmpty(newTouchId.getId())) {
dev = newTouchId;
} else if (Utils.isNotEmpty(newDevice.getNickName())) {
logger.debug("cancel invoked - platform authenticator");
} else if (Utils.isNotEmpty(newDevice.getId())) {
dev = newDevice;
logger.debug("cancel invoked");
}
if (dev != null) {
success = fido2Service.removeDevice(dev);
Expand Down

0 comments on commit a4ad06b

Please sign in to comment.