fix: fix infinite password expiry loop

Signed-off-by: Miguel Nogueira <me@nogueira.codes>
This commit is contained in:
2025-08-06 10:25:04 +01:00
parent f2a5a9fe6a
commit 2062cd247e

View File

@@ -21,7 +21,8 @@ class PasswordExpirationMiddleware
{
if (Auth::check()) {
$sinceUpdate = Carbon::parse(Auth::user()->password_last_updated)->diffInDays(now());
$updateThreshold = Options::getOption('password_expiry');
$updateThreshold = (int) Options::getOption('password_expiry');
if ($updateThreshold !== 0 && $sinceUpdate > $updateThreshold) {
session()->put('passwordExpired', true);