mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Implemented oauth session revocation notification.
Reworked webhooks notifications constructors
This commit is contained in:
@@ -5,6 +5,8 @@ namespace common\models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use common\components\UserPass;
|
||||
use common\notifications\AccountDeletedNotification;
|
||||
use common\notifications\AccountEditNotification;
|
||||
use common\tasks\CreateWebHooksDeliveries;
|
||||
use DateInterval;
|
||||
use Webmozart\Assert\Assert;
|
||||
@@ -181,12 +183,13 @@ class Account extends ActiveRecord {
|
||||
return;
|
||||
}
|
||||
|
||||
Yii::$app->queue->push(CreateWebHooksDeliveries::createAccountEdit($this, $meaningfulChangedAttributes));
|
||||
$notification = new AccountEditNotification($this, $meaningfulChangedAttributes);
|
||||
Yii::$app->queue->push(new CreateWebHooksDeliveries($notification));
|
||||
}
|
||||
|
||||
public function afterDelete(): void {
|
||||
parent::afterDelete();
|
||||
Yii::$app->queue->push(CreateWebHooksDeliveries::createAccountDeletion($this));
|
||||
Yii::$app->queue->push(new CreateWebHooksDeliveries(new AccountDeletedNotification($this)));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user