Skip to content

Commit

Permalink
log login factor verification failure
Browse files Browse the repository at this point in the history
  • Loading branch information
byewokko committed Jun 26, 2024
1 parent 8e74a05 commit 448e4ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions seacatauth/authn/login_descriptor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import typing
import asab

from .login_factors import LoginFactorABC

Expand Down Expand Up @@ -101,6 +102,11 @@ async def authenticate(self, login_session, request_data):
assert len(self.FactorGroups) == 1
for factor in self.FactorGroups[0]:
if (await factor.authenticate(login_session, request_data)) is False:
L.log(asab.LOG_NOTICE, "Login factor verification failed.", struct_data={
"descriptor_id": self.ID,
"factor_type": factor.Type,
"cid": login_session.CredentialsId,
})
return False
return True

Expand Down

0 comments on commit 448e4ec

Please sign in to comment.