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])
|
@Authorized([RIGHTS.QUERY_TRANSACTION_LINK])
|
||||||
@Query(() => QueryLinkResult)
|
@Query(() => QueryLinkResult)
|
||||||
async queryTransactionLink(@Arg('code') code: string): Promise<typeof QueryLinkResult> {
|
async queryTransactionLink(@Arg('code') code: string): Promise<typeof QueryLinkResult> {
|
||||||
if (/^CL-/.exec(code)) {
|
if (code.match(/^CL-/)) {
|
||||||
const contributionLink = await DbContributionLink.findOneOrFail(
|
const contributionLink = await DbContributionLink.findOneOrFail(
|
||||||
{ code: code.replace('CL-', '') },
|
{ code: code.replace('CL-', '') },
|
||||||
{ withDeleted: true },
|
{ withDeleted: true },
|
||||||
@ -154,7 +154,7 @@ export class TransactionLinkResolver {
|
|||||||
const clientTimezoneOffset = getClientTimezoneOffset(context)
|
const clientTimezoneOffset = getClientTimezoneOffset(context)
|
||||||
const user = getUser(context)
|
const user = getUser(context)
|
||||||
|
|
||||||
if (/^CL-/.exec(code)) {
|
if (code.match(/^CL-/)) {
|
||||||
// acquire lock
|
// acquire lock
|
||||||
const releaseLock = await TRANSACTIONS_LOCK.acquire()
|
const releaseLock = await TRANSACTIONS_LOCK.acquire()
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -280,7 +280,7 @@ export class UserResolver {
|
|||||||
dbUser.passwordEncryptionType = PasswordEncryptionType.NO_PASSWORD
|
dbUser.passwordEncryptionType = PasswordEncryptionType.NO_PASSWORD
|
||||||
logger.debug('new dbUser', dbUser)
|
logger.debug('new dbUser', dbUser)
|
||||||
if (redeemCode) {
|
if (redeemCode) {
|
||||||
if (/^CL-/.exec(redeemCode)) {
|
if (redeemCode.match(/^CL-/)) {
|
||||||
const contributionLink = await DbContributionLink.findOne({
|
const contributionLink = await DbContributionLink.findOne({
|
||||||
code: redeemCode.replace('CL-', ''),
|
code: redeemCode.replace('CL-', ''),
|
||||||
})
|
})
|
||||||
|
|||||||
@ -12,7 +12,7 @@ const sodium = require('sodium-native')
|
|||||||
|
|
||||||
// We will reuse this for changePassword
|
// We will reuse this for changePassword
|
||||||
export const isValidPassword = (password: string): boolean => {
|
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[] => {
|
export const SecretKeyCryptographyCreateKey = (salt: string, password: string): Buffer[] => {
|
||||||
|
|||||||
@ -119,7 +119,7 @@ export const elopageWebhook = async (req: any, res: any): Promise<void> => {
|
|||||||
// Validate inputs
|
// Validate inputs
|
||||||
if (
|
if (
|
||||||
email === '' ||
|
email === '' ||
|
||||||
!VALIDATE_EMAIL.exec(email) ||
|
!email.match(VALIDATE_EMAIL) ||
|
||||||
firstName === '' ||
|
firstName === '' ||
|
||||||
firstName.match(VALIDATE_NAME) ||
|
firstName.match(VALIDATE_NAME) ||
|
||||||
lastName === '' ||
|
lastName === '' ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user