Skip to content

Commit e8a19e7

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

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
@@ -10,12 +10,13 @@
1010
namespace OCP\User\Events;
1111

1212
use OCP\EventDispatcher\Event;
13+
use OCP\EventDispatcher\IWebhookCompatibleEvent;
1314
use OCP\IUser;
1415

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

0 commit comments

Comments
 (0)