Skip to content

Commit caf2fcd

Browse files
committed
feat: make first login event webhook compatible
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 887dfeb commit caf2fcd

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

lib/public/User/Events/UserFirstTimeLoggedInEvent.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
namespace OCP\User\Events;
1010

1111
use OCP\EventDispatcher\Event;
12+
use OCP\EventDispatcher\IWebhookCompatibleEvent;
1213
use OCP\IUser;
1314

1415
/**
1516
* @since 28.0.0
1617
*/
17-
class UserFirstTimeLoggedInEvent extends Event {
18+
class UserFirstTimeLoggedInEvent extends Event implements IWebhookCompatibleEvent {
1819
/**
1920
* @since 28.0.0
2021
*/
@@ -30,4 +31,16 @@ public function __construct(
3031
public function getUser(): IUser {
3132
return $this->user;
3233
}
34+
35+
/**
36+
* @since 34.0.0
37+
*/
38+
#[\Override]
39+
public function getWebhookSerializable(): array {
40+
return [
41+
'user_id' => $this->user->getUID(),
42+
'display_name' => $this->user->getDisplayName(),
43+
'email' => $this->user->getEMailAddress(),
44+
];
45+
}
3346
}

0 commit comments

Comments
 (0)