Added new password broker for longer toekn lifetime

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-07-16 16:23:11 +01:00
parent b6c6b025c8
commit fd8f90cb52
2 changed files with 14 additions and 3 deletions

View File

@@ -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');
}
/**

View File

@@ -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),
]
],
],
/*