Lista Friends
This commit is contained in:
12
src/validation/email.ts
Normal file
12
src/validation/email.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
const isEmail = (email: string) => {
|
||||
const res = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return res.test(String(email).toLowerCase())
|
||||
// let re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
// return !re.test(fieldValue) ? 'The input is not a valid ' + fieldName + ' address' : '';
|
||||
}
|
||||
export function email(email: string) {
|
||||
|
||||
return isEmail(email)
|
||||
|
||||
}
|
||||
@@ -4,3 +4,4 @@ export { aportadorexist } from './aportadorexist'
|
||||
export { registeredemail } from './registeredemail'
|
||||
export { complexity } from './complexity'
|
||||
export { alfanum } from './alfanum'
|
||||
export { email } from './email'
|
||||
|
||||
@@ -5,7 +5,7 @@ import { helpers } from '@vuelidate/validators'
|
||||
const { withAsync } = helpers
|
||||
|
||||
// const SITE_URL = GlobalConfig.uri.site
|
||||
const VALIDATE_USER_URL = process.env.MONGODB_HOST + '/email/'
|
||||
const VALIDATE_USER_URL = process.env.MONGODB_HOST + '/email/ck'
|
||||
|
||||
export const registeredemail = withAsync(_registeredemail)
|
||||
|
||||
@@ -15,7 +15,7 @@ export function _registeredemail(email: string) {
|
||||
return res.status !== PayloadMessageTypes.statusfound
|
||||
}
|
||||
|
||||
return Axios.get(VALIDATE_USER_URL + process.env.APP_ID + '/' + email)
|
||||
return Axios.post(VALIDATE_USER_URL, {idapp: process.env.APP_ID, email, key: process.env.PAO_APP_ID})
|
||||
.then(onSuccess)
|
||||
.catch((err) => {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user