fix: ensures email is still prefilled in auth configs

This commit is contained in:
James
2021-04-02 12:59:15 -04:00
parent dff72fbf2f
commit 31c41c22ec
4 changed files with 5 additions and 9 deletions

View File

@@ -12,9 +12,7 @@ const buildValidationPromise = async (fieldState: Field, field: FieldSchema, ful
let validationResult: boolean | string = true;
if (!passesConditionalLogic) {
validationResult = true;
} else if (typeof field.validate === 'function') {
if (passesConditionalLogic && typeof field.validate === 'function') {
validationResult = await field.validate(fieldState.value, field);
}

View File

@@ -27,10 +27,6 @@ const formatFields = (config) => {
if (config.auth) {
fields = fields.concat([
{
name: 'email',
label: 'Email',
type: 'email',
}, {
name: 'enableAPIKey',
label: 'Enable API Key for this user',
type: 'checkbox',

View File

@@ -8,7 +8,9 @@ export default [
type: 'email',
validate: email,
admin: {
disabled: true,
components: {
Field: () => null,
},
},
},
{