mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-13 16:16:59 +02:00
Added ability to have password policy and password expiration
This commit is contained in:
parent
e0eeaed83c
commit
2620dfd7f3
5 changed files with 51 additions and 3 deletions
|
@ -93,6 +93,13 @@ class AuthController extends Controller
|
|||
unset($_SESSION['2fa_email'], $_SESSION['2fa_password'], $_SESSION['is2FAEnabled']);
|
||||
|
||||
if ($login===true) {
|
||||
// Check if password renewal is needed
|
||||
$passwordLastChanged = $_SESSION['password_last_changed'][$_SESSION['auth_user_id']] ?? 0;
|
||||
if (checkPasswordRenewal($passwordLastChanged)) {
|
||||
Auth::logout();
|
||||
redirect()->route('forgot.password')->with('error','Your password is expired. Please change it');
|
||||
}
|
||||
|
||||
$db = $container->get('db');
|
||||
$currentDateTime = new \DateTime();
|
||||
$currentDate = $currentDateTime->format('Y-m-d H:i:s.v'); // Current timestamp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue