update attribute errors
This commit is contained in:
parent
1904e3df81
commit
4e1a4b961c
2 changed files with 10 additions and 10 deletions
|
@ -112,11 +112,11 @@ App::post('/v1/account')
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
'emailVerification' => false,
|
'emailVerification' => false,
|
||||||
'status' => true,
|
'status' => true,
|
||||||
'passwordHistory' => $passwordHistory > 0 ? [$password] : [],
|
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
|
'passwordHistory' => $passwordHistory > 0 ? [$password] : [],
|
||||||
|
'passwordUpdate' => DateTime::now(),
|
||||||
'hash' => Auth::DEFAULT_ALGO,
|
'hash' => Auth::DEFAULT_ALGO,
|
||||||
'hashOptions' => Auth::DEFAULT_ALGO_OPTIONS,
|
'hashOptions' => Auth::DEFAULT_ALGO_OPTIONS,
|
||||||
'passwordUpdate' => DateTime::now(),
|
|
||||||
'registration' => DateTime::now(),
|
'registration' => DateTime::now(),
|
||||||
'reset' => false,
|
'reset' => false,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
|
@ -1561,11 +1561,11 @@ App::patch('/v1/account/password')
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $dbForProject->updateDocument('users', $user->getId(), $user
|
$user = $dbForProject->updateDocument('users', $user->getId(), $user
|
||||||
->setAttribute('passwordHistory', $history)
|
|
||||||
->setAttribute('password', $newPassword)
|
->setAttribute('password', $newPassword)
|
||||||
|
->setAttribute('passwordHistory', $history)
|
||||||
|
->setAttribute('passwordUpdate', DateTime::now()));
|
||||||
->setAttribute('hash', Auth::DEFAULT_ALGO)
|
->setAttribute('hash', Auth::DEFAULT_ALGO)
|
||||||
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
|
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
|
||||||
->setAttribute('passwordUpdate', DateTime::now()));
|
|
||||||
|
|
||||||
$events->setParam('userId', $user->getId());
|
$events->setParam('userId', $user->getId());
|
||||||
|
|
||||||
|
@ -2133,9 +2133,9 @@ App::put('/v1/account/recovery')
|
||||||
|
|
||||||
$profile = $dbForProject->updateDocument('users', $profile->getId(), $profile
|
$profile = $dbForProject->updateDocument('users', $profile->getId(), $profile
|
||||||
->setAttribute('password', Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS))
|
->setAttribute('password', Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS))
|
||||||
|
->setAttribute('passwordUpdate', DateTime::now())
|
||||||
->setAttribute('hash', Auth::DEFAULT_ALGO)
|
->setAttribute('hash', Auth::DEFAULT_ALGO)
|
||||||
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
|
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
|
||||||
->setAttribute('passwordUpdate', DateTime::now())
|
|
||||||
->setAttribute('emailVerification', true));
|
->setAttribute('emailVerification', true));
|
||||||
|
|
||||||
$recoveryDocument = $dbForProject->getDocument('tokens', $recovery);
|
$recoveryDocument = $dbForProject->getDocument('tokens', $recovery);
|
||||||
|
|
|
@ -65,11 +65,11 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e
|
||||||
'phone' => $phone,
|
'phone' => $phone,
|
||||||
'phoneVerification' => false,
|
'phoneVerification' => false,
|
||||||
'status' => true,
|
'status' => true,
|
||||||
'passwordHistory' => is_null($password) && $passwordHistory === 0 ? [] : [$password],
|
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
|
'passwordHistory' => is_null($password) && $passwordHistory === 0 ? [] : [$password],
|
||||||
|
'passwordUpdate' => (!empty($password)) ? DateTime::now() : null,
|
||||||
'hash' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO : $hash,
|
'hash' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO : $hash,
|
||||||
'hashOptions' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO_OPTIONS : $hashOptionsObject + ['type' => $hash],
|
'hashOptions' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO_OPTIONS : $hashOptionsObject + ['type' => $hash],
|
||||||
'passwordUpdate' => (!empty($password)) ? DateTime::now() : null,
|
|
||||||
'registration' => DateTime::now(),
|
'registration' => DateTime::now(),
|
||||||
'reset' => false,
|
'reset' => false,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
|
@ -822,11 +822,11 @@ App::patch('/v1/users/:userId/password')
|
||||||
}
|
}
|
||||||
|
|
||||||
$user
|
$user
|
||||||
->setAttribute('passwordHistory', $history)
|
|
||||||
->setAttribute('password', $newPassword)
|
->setAttribute('password', $newPassword)
|
||||||
|
->setAttribute('passwordHistory', $history)
|
||||||
|
->setAttribute('passwordUpdate', DateTime::now())
|
||||||
->setAttribute('hash', Auth::DEFAULT_ALGO)
|
->setAttribute('hash', Auth::DEFAULT_ALGO)
|
||||||
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
|
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS);
|
||||||
->setAttribute('passwordUpdate', DateTime::now());
|
|
||||||
|
|
||||||
$user = $dbForProject->updateDocument('users', $user->getId(), $user);
|
$user = $dbForProject->updateDocument('users', $user->getId(), $user);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue