No need for card presence during removal

This commit is contained in:
Peter D. Gray 2023-02-08 12:35:51 -05:00
parent 17b5cdf672
commit 2cfd6f0860
No known key found for this signature in database
GPG Key ID: F0E6CC6AFC16CF7B
2 changed files with 5 additions and 11 deletions

View File

@ -45,9 +45,10 @@ enrolled card).
"Check Card" validates the card inserted and indicates if it would
be accepted or not.
Use "Remove Card #N" is remove cards from the system. When the last
card is removed, the feature is disabled and no card will be required
for login.
Use "Remove Card #N" is remove cards from the approved list. When
the last card is removed, the feature is disabled and no card will
be required for login. Access to the card in question is not required
to remove it.
## During Login

View File

@ -271,7 +271,7 @@ class MicroSD2FA(PassphraseSaver):
async def remove(self, nonce):
# remove indicated nonce from records
# - delete file if present and found, but ok if missing
# - doesn't delete file, since might not have card anymore and useless w/o nonce
from glob import dis, settings
v = self.get_nonces()
@ -282,13 +282,6 @@ class MicroSD2FA(PassphraseSaver):
else:
settings.set('sd2fa', v2)
settings.save()
try:
with CardSlot() as card:
fn = self.filename(card)
os.remove(fn)
except:
pass
@classmethod
def menu(cls):