mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
validate valitity of userpassword when updating it via updateUserInfos
This commit is contained in:
parent
e0490827c7
commit
cc596df22a
@ -592,6 +592,13 @@ export class UserResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (password && passwordNew) {
|
if (password && passwordNew) {
|
||||||
|
// Validate Password
|
||||||
|
if (!isPassword(passwordNew)) {
|
||||||
|
throw new Error(
|
||||||
|
'Please enter a valid password with at least 8 characters, upper and lower case letters, at least one number and one special character!',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This had some error cases defined - like missing private key. This is no longer checked.
|
// TODO: This had some error cases defined - like missing private key. This is no longer checked.
|
||||||
const oldPasswordHash = SecretKeyCryptographyCreateKey(userEntity.email, password)
|
const oldPasswordHash = SecretKeyCryptographyCreateKey(userEntity.email, password)
|
||||||
if (BigInt(userEntity.password.toString()) !== oldPasswordHash[0].readBigUInt64LE()) {
|
if (BigInt(userEntity.password.toString()) !== oldPasswordHash[0].readBigUInt64LE()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user