Skip to content

Commit

Permalink
new library returns error
Browse files Browse the repository at this point in the history
  • Loading branch information
bitte-ein-bit committed Dec 17, 2024
1 parent 88b9619 commit ed1e800
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yubikey/yubikey.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const yubiKeyVendorID uint16 = 0x1050
func IsAttached() bool {

// List all USB devices matching the YubiKey vendor ID
devices := hid.Enumerate(yubiKeyVendorID, 0)
devices, err := hid.Enumerate(yubiKeyVendorID, 0)
if err != nil {
log.WithError(err).Error("Failed to enumerate USB devices")
return false
}

if len(devices) == 0 {
log.Debug("No YubiKey device detected")
Expand Down

0 comments on commit ed1e800

Please sign in to comment.