Skip to content

A free open source IT asset/license management system

Added new password broker for longer toekn lifetime

snipefd8f90cb5228
diff --git a/app/Notifications/WelcomeNotification.php b/app/Notifications/WelcomeNotification.php
index 7c456d1ac1..68d852e392 100644
--- a/app/Notifications/WelcomeNotification.php
+++ b/app/Notifications/WelcomeNotification.php
@@ -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');
}
/**
diff --git a/config/auth.php b/config/auth.php
index 1603c93337..de74b33663 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -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),
+ ]
+ ],
],
/*