mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 2600-Menu-Creation-select-Contribute
This commit is contained in:
commit
97ec9f76f7
@ -96,7 +96,7 @@ describe('EmailOptinCodes', () => {
|
|||||||
mutate({ mutation: forgotPassword, variables: { email: 'peter@lustig.de' } }),
|
mutate({ mutation: forgotPassword, variables: { email: 'peter@lustig.de' } }),
|
||||||
).resolves.toMatchObject({
|
).resolves.toMatchObject({
|
||||||
data: null,
|
data: null,
|
||||||
errors: [new GraphQLError('email already sent less than 10 minutes minutes ago')],
|
errors: [new GraphQLError('email already sent less than 10 minutes ago')],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -830,7 +830,7 @@ describe('UserResolver', () => {
|
|||||||
new GraphQLError(
|
new GraphQLError(
|
||||||
`email already sent less than ${printTimeDuration(
|
`email already sent less than ${printTimeDuration(
|
||||||
CONFIG.EMAIL_CODE_REQUEST_TIME,
|
CONFIG.EMAIL_CODE_REQUEST_TIME,
|
||||||
)} minutes ago`,
|
)} ago`,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
@ -870,13 +870,13 @@ describe('UserResolver', () => {
|
|||||||
CONFIG.EMAIL_CODE_REQUEST_TIME = emailCodeRequestTime
|
CONFIG.EMAIL_CODE_REQUEST_TIME = emailCodeRequestTime
|
||||||
await expect(mutate({ mutation: forgotPassword, variables })).resolves.toEqual(
|
await expect(mutate({ mutation: forgotPassword, variables })).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
errors: [new GraphQLError('email already sent less than 10 minutes minutes ago')],
|
errors: [new GraphQLError('email already sent less than 10 minutes ago')],
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('logs the error found', () => {
|
it('logs the error found', () => {
|
||||||
expect(logger.error).toBeCalledWith(`email already sent less than 10 minutes minutes ago`)
|
expect(logger.error).toBeCalledWith(`email already sent less than 10 minutes ago`)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -392,16 +392,11 @@ export class UserResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!canEmailResend(user.emailContact.updatedAt || user.emailContact.createdAt)) {
|
if (!canEmailResend(user.emailContact.updatedAt || user.emailContact.createdAt)) {
|
||||||
logger.error(
|
const errorMessage = `email already sent less than ${printTimeDuration(
|
||||||
`email already sent less than ${printTimeDuration(
|
CONFIG.EMAIL_CODE_REQUEST_TIME,
|
||||||
CONFIG.EMAIL_CODE_REQUEST_TIME,
|
)} ago`
|
||||||
)} minutes ago`,
|
logger.error(errorMessage)
|
||||||
)
|
throw new Error(errorMessage)
|
||||||
throw new Error(
|
|
||||||
`email already sent less than ${printTimeDuration(
|
|
||||||
CONFIG.EMAIL_CODE_REQUEST_TIME,
|
|
||||||
)} minutes ago`,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
user.emailContact.updatedAt = new Date()
|
user.emailContact.updatedAt = new Date()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user