generated from fintechbd/package-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4be1093
commit ddc1aaa
Showing
6 changed files
with
87 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Fintech\Auth\Events; | ||
|
||
use Fintech\Core\Attributes\ManagedByTrigger; | ||
use Fintech\Core\Attributes\Variable; | ||
use Fintech\Core\Interfaces\Bell\HasDynamicString; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
#[ManagedByTrigger( | ||
name: 'User Account Frozen/Suspended', | ||
description: 'When someone tries to enter into their account using the incorrect password and the number of incorrect passwords exceeds the threshold, this trigger is set off.', | ||
enabled: true, | ||
variables: [ | ||
new Variable(name: '__account_name__', description: 'Name of the user tried login.'), | ||
new Variable(name: '__account_mobile__', description: 'Mobile number associate with requested user.'), | ||
new Variable(name: '__account_email__', description: 'Email address associate with requested user.'), | ||
new Variable(name: '__password_attempt_count__', description: 'Number of times wrong password attempted.'), | ||
new Variable(name: '__account_status__', description: 'User account before frozen/suspended status.'), | ||
new Variable(name: '__password_attempt_limit__', description: 'The maximum number of times a user may try to customize my system.'), | ||
], | ||
recipients: [] | ||
)] | ||
class AccountFrozen implements HasDynamicString | ||
{ | ||
use Dispatchable; | ||
use SerializesModels; | ||
|
||
public mixed $user; | ||
|
||
public function aliases(): array | ||
{ | ||
return [ | ||
'__account_name__' => $this->user->name ?? '', | ||
'__account_mobile__' => $this->user->mobile ?? '', | ||
'__account_email__' => $this->user->email ?? '', | ||
'__password_attempt_count__' => $this->user->wrong_password ?? '', | ||
'__account_status__' => $this->user->status ?? '', | ||
'__password_attempt_limit__' => config('fintech.auth.password_threshold', 10), | ||
]; | ||
} | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct($user) | ||
{ | ||
$this->user = $user; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters