Skip to content

Commit a86951b

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

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/public/User/Events/UserFirstTimeLoggedInEvent.php

Lines changed: 10 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,12 @@ public function __construct(
3031
public function getUser(): IUser {
3132
return $this->user;
3233
}
34+
35+
public function getWebhookSerializable(): array {
36+
return [
37+
'user_id' => $this->user->getUID(),
38+
'display_name' => $this->user->getDisplayName(),
39+
'email' => $this->user->getEMailAddress(),
40+
];
41+
}
3342
}

0 commit comments

Comments
 (0)