Skip to content

Commit aee164e

Browse files
committed
Additional webhook hints
1 parent 0aaf12f commit aee164e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/WebhookParser.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22
namespace Fident\Webhooks;
33

4+
use Fident\Webhooks\Generated\V1\ChangeEmailLink;
5+
use Fident\Webhooks\Generated\V1\EmailUpdate;
46
use Fident\Webhooks\Generated\V1\LoginLink;
7+
use Fident\Webhooks\Generated\V1\PasswordUpdate;
8+
use Fident\Webhooks\Generated\V1\ProfileUpdate;
59
use Fident\Webhooks\Generated\V1\ResetPasswordLink;
610
use Fident\Webhooks\Generated\V1\VerifyAccount;
711
use Fident\Webhooks\Generated\V1\VerifySetPasswordLink;
@@ -73,6 +77,18 @@ public function parse(string $rawPayload): Webhook
7377
case Webhook::TYPE_VERIFY_ACCOUNT:
7478
$hook->data = VerifyAccount::fromSource($this->_decodeJson($hook->data));
7579
break;
80+
case Webhook::TYPE_CHANGE_EMAIL_LINK:
81+
$hook->data = ChangeEmailLink::fromSource($this->_decodeJson($hook->data));
82+
break;
83+
case Webhook::TYPE_PROFILE_UPDATE:
84+
$hook->data = ProfileUpdate::fromSource($this->_decodeJson($hook->data));
85+
break;
86+
case Webhook::TYPE_PASSWORD_UPDATE:
87+
$hook->data = PasswordUpdate::fromSource($this->_decodeJson($hook->data));
88+
break;
89+
case Webhook::TYPE_EMAIL_UPDATE:
90+
$hook->data = EmailUpdate::fromSource($this->_decodeJson($hook->data));
91+
break;
7692
}
7793

7894
return $hook;

0 commit comments

Comments
 (0)