mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into refactor_arithmetic_merge
This commit is contained in:
commit
5847f723c6
@ -192,14 +192,11 @@ export class TransactionResolver {
|
|||||||
transactionReceive.linkedUserId = senderUser.id
|
transactionReceive.linkedUserId = senderUser.id
|
||||||
transactionReceive.amount = amount
|
transactionReceive.amount = amount
|
||||||
const receiveBalance = await calculateBalance(recipientUser.id, amount, receivedCallDate)
|
const receiveBalance = await calculateBalance(recipientUser.id, amount, receivedCallDate)
|
||||||
if (!receiveBalance) {
|
transactionReceive.balance = receiveBalance ? receiveBalance.balance : amount
|
||||||
throw new Error('Sender user account corrupted')
|
|
||||||
}
|
|
||||||
transactionReceive.balance = receiveBalance.balance
|
|
||||||
transactionReceive.balanceDate = receivedCallDate
|
transactionReceive.balanceDate = receivedCallDate
|
||||||
transactionReceive.decay = receiveBalance.decay.decay
|
transactionReceive.decay = receiveBalance ? receiveBalance.decay.decay : new Decimal(0)
|
||||||
transactionReceive.decayStart = receiveBalance.decay.start
|
transactionReceive.decayStart = receiveBalance ? receiveBalance.decay.start : null
|
||||||
transactionReceive.previous = receiveBalance.lastTransactionId
|
transactionReceive.previous = receiveBalance ? receiveBalance.lastTransactionId : null
|
||||||
transactionReceive.linkedTransactionId = transactionSend.id
|
transactionReceive.linkedTransactionId = transactionSend.id
|
||||||
await queryRunner.manager.insert(dbTransaction, transactionReceive)
|
await queryRunner.manager.insert(dbTransaction, transactionReceive)
|
||||||
|
|
||||||
|
|||||||
@ -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