enables optional api key auth

This commit is contained in:
James
2020-06-09 13:42:20 -04:00
parent 3d56373247
commit fee6170748
6 changed files with 42 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
const validations = require('../fields/validations');
module.exports = [
{
name: 'enableAPIKey',
label: 'Enable API key for this user',
type: 'checkbox',
defaultValue: false,
validate: validations.checkbox,
},
{
name: 'apiKey',
type: 'text',
label: 'User API Key',
condition: (_, siblings) => {
return siblings.enableAPIKey && siblings.enableAPIKey.value;
},
validate: validations.text,
},
];