|
|
@ -1,4 +1,5 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
|
|
|
|
import { validatePassword } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
definePageMeta, |
|
|
|
definePageMeta, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
@ -43,7 +44,7 @@ const formRules = { |
|
|
|
{ |
|
|
|
{ |
|
|
|
validator: (_: unknown, v: string) => { |
|
|
|
validator: (_: unknown, v: string) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if (isEmail(v)) return resolve(true) |
|
|
|
if (!v?.length || isEmail(v)) return resolve(true) |
|
|
|
reject(new Error(t('msg.error.signUpRules.emailInvalid'))) |
|
|
|
reject(new Error(t('msg.error.signUpRules.emailInvalid'))) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -51,9 +52,15 @@ const formRules = { |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
password: [ |
|
|
|
password: [ |
|
|
|
// Password is required |
|
|
|
{ |
|
|
|
{ required: true, message: t('msg.error.signUpRules.passwdRequired') }, |
|
|
|
validator: (_: unknown, v: string) => { |
|
|
|
{ min: 8, message: t('msg.error.signUpRules.passwdLength') }, |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
|
|
const { error, valid } = validatePassword(v) |
|
|
|
|
|
|
|
if (valid) return resolve(true) |
|
|
|
|
|
|
|
reject(new Error(error)) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|