Skip to content

Commit e9163b4

Browse files
ncosta-icnilmerg
authored andcommitted
feat(Session): provide authenticated_at programmatically
1 parent 0028789 commit e9163b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/Notifications/ProvidedHook/SessionStorage.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Icinga\Module\Notifications\ProvidedHook;
66

7+
use DateTime;
78
use Icinga\Application\Hook\AuthenticationHook;
89
use Icinga\Application\Logger;
910
use Icinga\Module\Notifications\Common\Database;
@@ -90,9 +91,10 @@ public function onLogin(User $user): void
9091
$this->database->insert(
9192
'browser_session',
9293
[
93-
'php_session_id' => $this->session->getId(),
94-
'username' => trim($user->getUsername()),
95-
'user_agent' => $userAgent
94+
'php_session_id' => $this->session->getId(),
95+
'username' => trim($user->getUsername()),
96+
'user_agent' => $userAgent,
97+
'authenticated_at' => (new DateTime())->format('Uv')
9698
]
9799
);
98100
$this->database->commitTransaction();

0 commit comments

Comments
 (0)