From 3baffaef2d94a4ec3f4cb3ba4335b0c64520c523 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Tue, 1 Nov 2022 10:37:50 +0100 Subject: [PATCH] log failed sign in --- src/Application/Controller/Admin/d3webauthnadminlogin.php | 2 ++ src/Application/Controller/d3webauthnlogin.php | 2 ++ src/Application/Model/WebauthnErrors.php | 1 + 3 files changed, 5 insertions(+) diff --git a/src/Application/Controller/Admin/d3webauthnadminlogin.php b/src/Application/Controller/Admin/d3webauthnadminlogin.php index a562555..e8e0596 100755 --- a/src/Application/Controller/Admin/d3webauthnadminlogin.php +++ b/src/Application/Controller/Admin/d3webauthnadminlogin.php @@ -110,6 +110,8 @@ class d3webauthnadminlogin extends AdminController } } catch (AssertionFailedException|WebauthnException $e) { Registry::getUtilsView()->addErrorToDisplay($e->getMessage()); + // ToDo: add requested username + Registry::getLogger()->info($e->getMessage()); $user->logout(); $this->getUtils()->redirect('index.php?cl=login'); diff --git a/src/Application/Controller/d3webauthnlogin.php b/src/Application/Controller/d3webauthnlogin.php index 66a7733..06aa670 100755 --- a/src/Application/Controller/d3webauthnlogin.php +++ b/src/Application/Controller/d3webauthnlogin.php @@ -111,6 +111,8 @@ class d3webauthnlogin extends FrontendController } catch (AssertionFailedException|WebauthnException $e) { Registry::getUtilsView()->addErrorToDisplay($e->getMessage()); + // ToDo: add requested username + Registry::getLogger()->info($e->getMessage()); $user->logout(); $this->getUtils()->redirect('index.php?cl=start'); diff --git a/src/Application/Model/WebauthnErrors.php b/src/Application/Model/WebauthnErrors.php index 81fce30..bbdc41b 100644 --- a/src/Application/Model/WebauthnErrors.php +++ b/src/Application/Model/WebauthnErrors.php @@ -38,6 +38,7 @@ class WebauthnErrors return $lang->translateString('D3_WEBAUTHN_ERR_UNKNOWN', null, true); case self::NOPUBKEYSUPPORT: return $lang->translateString('D3_WEBAUTHN_ERR_NOPUBKEYSUPPORT', null, true); + // ToDo: translate messages from Webauthn package like "The credential ID is invalid." } return $msg;