mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
revert regex.exec to string.match
This commit is contained in:
parent
09d2db3028
commit
b530576a84
@ -128,7 +128,7 @@ export class TransactionLinkResolver {
|
||||
@Authorized([RIGHTS.QUERY_TRANSACTION_LINK])
|
||||
@Query(() => QueryLinkResult)
|
||||
async queryTransactionLink(@Arg('code') code: string): Promise<typeof QueryLinkResult> {
|
||||
if (/^CL-/.exec(code)) {
|
||||
if (code.match(/^CL-/)) {
|
||||
const contributionLink = await DbContributionLink.findOneOrFail(
|
||||
{ code: code.replace('CL-', '') },
|
||||
{ withDeleted: true },
|
||||
@ -154,7 +154,7 @@ export class TransactionLinkResolver {
|
||||
const clientTimezoneOffset = getClientTimezoneOffset(context)
|
||||
const user = getUser(context)
|
||||
|
||||
if (/^CL-/.exec(code)) {
|
||||
if (code.match(/^CL-/)) {
|
||||
// acquire lock
|
||||
const releaseLock = await TRANSACTIONS_LOCK.acquire()
|
||||
try {
|
||||
|
||||
@ -280,7 +280,7 @@ export class UserResolver {
|
||||
dbUser.passwordEncryptionType = PasswordEncryptionType.NO_PASSWORD
|
||||
logger.debug('new dbUser', dbUser)
|
||||
if (redeemCode) {
|
||||
if (/^CL-/.exec(redeemCode)) {
|
||||
if (redeemCode.match(/^CL-/)) {
|
||||
const contributionLink = await DbContributionLink.findOne({
|
||||
code: redeemCode.replace('CL-', ''),
|
||||
})
|
||||
|
||||
@ -12,7 +12,7 @@ const sodium = require('sodium-native')
|
||||
|
||||
// We will reuse this for changePassword
|
||||
export const isValidPassword = (password: string): boolean => {
|
||||
return !!/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^a-zA-Z0-9 \\t\\n\\r]).{8,}$/.exec(password)
|
||||
return !!password.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^a-zA-Z0-9 \\t\\n\\r]).{8,}$/)
|
||||
}
|
||||
|
||||
export const SecretKeyCryptographyCreateKey = (salt: string, password: string): Buffer[] => {
|
||||
|
||||
@ -119,7 +119,7 @@ export const elopageWebhook = async (req: any, res: any): Promise<void> => {
|
||||
// Validate inputs
|
||||
if (
|
||||
email === '' ||
|
||||
!VALIDATE_EMAIL.exec(email) ||
|
||||
!email.match(VALIDATE_EMAIL) ||
|
||||
firstName === '' ||
|
||||
firstName.match(VALIDATE_NAME) ||
|
||||
lastName === '' ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user