Added new password broker for longer toekn lifetime
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
@@ -11,7 +11,8 @@ use App\Models\User;
|
||||
class WelcomeNotification extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
|
||||
public $expire_date;
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*
|
||||
@@ -19,8 +20,8 @@ class WelcomeNotification extends Notification
|
||||
*/
|
||||
public function __construct(public User $user)
|
||||
{
|
||||
$this->user->token = Password::getRepository()->create($user);
|
||||
|
||||
$this->user->token = Password::broker('invites')->createToken($user);
|
||||
$this->user->expire_date = now()->addMinutes((int) config('auth.passwords.invites.expire', 2880))->format('F j, Y, g:i a');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -104,6 +104,16 @@ return [
|
||||
]
|
||||
|
||||
],
|
||||
|
||||
'invites' => [
|
||||
'provider' => 'users',
|
||||
'table' => 'password_resets',
|
||||
'expire' => env('INVITE_PASSWORD_LINK_EXPIRES', 2880),
|
||||
'throttle' => [
|
||||
'max_attempts' => env('LOGIN_MAX_ATTEMPTS', 5),
|
||||
'lockout_duration' => env('LOGIN_LOCKOUT_DURATION', 60),
|
||||
]
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user