mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #60305 from nextcloud/first-login-webhook
feat: make first login event webhook compatible
This commit is contained in:
commit
354e26d151
1 changed files with 13 additions and 1 deletions
|
|
@ -10,12 +10,14 @@ declare(strict_types=1);
|
|||
namespace OCP\User\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IWebhookCompatibleEvent;
|
||||
use OCP\EventDispatcher\JsonSerializer;
|
||||
use OCP\IUser;
|
||||
|
||||
/**
|
||||
* @since 28.0.0
|
||||
*/
|
||||
class UserFirstTimeLoggedInEvent extends Event {
|
||||
class UserFirstTimeLoggedInEvent extends Event implements IWebhookCompatibleEvent {
|
||||
/**
|
||||
* @since 28.0.0
|
||||
*/
|
||||
|
|
@ -31,4 +33,14 @@ class UserFirstTimeLoggedInEvent extends Event {
|
|||
public function getUser(): IUser {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 34.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getWebhookSerializable(): array {
|
||||
return [
|
||||
'user' => JsonSerializer::serializeUser($this->user)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue