feat(auth): Refactor mobile authentication config to support whitelist functionality

This commit is contained in:
web@ppanel
2025-02-14 22:13:50 +07:00
parent 5bac933fbc
commit c761ec7538
12 changed files with 92 additions and 49 deletions
@@ -29,6 +29,7 @@ export default function RegisterForm({
const t = useTranslations('auth.register');
const { common } = useGlobalStore();
const { verify, auth, invite } = common;
const { enable_whitelist, whitelist } = auth.mobile;
const formSchema = z
.object({
@@ -87,6 +88,7 @@ export default function RegisterForm({
className='w-32 rounded-r-none border-r-0'
placeholder='Area code...'
value={field.value}
whitelist={enable_whitelist ? whitelist : []}
onChange={(value) => {
if (value.phone) {
form.setValue('telephone_area_code', value.phone);