Bladeren bron

fix: email reg (#135)

tags/0.2.2
Joel 2 jaren geleden
bovenliggende
commit
17a8118154
No account linked to committer's email address
4 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 1
    1
      api/libs/helper.py
  2. 1
    1
      web/app/install/installForm.tsx
  3. 1
    1
      web/app/signin/normalForm.tsx
  4. 3
    3
      web/config/index.ts

+ 1
- 1
api/libs/helper.py Bestand weergeven



def email(email): def email(email):
# Define a regex pattern for email addresses # Define a regex pattern for email addresses
pattern = r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,4}$"
pattern = r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$"
# Check if the email matches the pattern # Check if the email matches the pattern
if re.match(pattern, email) is not None: if re.match(pattern, email) is not None:
return email return email

+ 1
- 1
web/app/install/installForm.tsx Bestand weergeven

import Toast from '../components/base/toast' import Toast from '../components/base/toast'
import { setup } from '@/service/common' import { setup } from '@/service/common'


const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,4}$/
const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/
const validPassword = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/ const validPassword = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/


const InstallForm = () => { const InstallForm = () => {

+ 1
- 1
web/app/signin/normalForm.tsx Bestand weergeven

import { login, oauth } from '@/service/common' import { login, oauth } from '@/service/common'
import { apiPrefix } from '@/config' import { apiPrefix } from '@/config'


const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,4}$/
const validEmailReg = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/


type IState = { type IState = {
formValid: boolean formValid: boolean

+ 3
- 3
web/config/index.ts Bestand weergeven



export const DEFAULT_VALUE_MAX_LEN = 48 export const DEFAULT_VALUE_MAX_LEN = 48


export const zhRegex = /^[\u4e00-\u9fa5]$/gm
export const emojiRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/gm
export const emailRegex = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,4}$/gm
export const zhRegex = /^[\u4e00-\u9fa5]$/m
export const emojiRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/m
export const emailRegex = /^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$/m
const MAX_ZN_VAR_NAME_LENGHT = 8 const MAX_ZN_VAR_NAME_LENGHT = 8
const MAX_EN_VAR_VALUE_LENGHT = 16 const MAX_EN_VAR_VALUE_LENGHT = 16
export const getMaxVarNameLength = (value: string) => { export const getMaxVarNameLength = (value: string) => {

Laden…
Annuleren
Opslaan