add length option to template
This commit is contained in:
@@ -159,6 +159,9 @@ export default [
|
||||
"label": "Secret Key Base",
|
||||
"defaultValue": "$$generate_passphrase",
|
||||
"description": "",
|
||||
"details": {
|
||||
"length":64
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "$$config_disable_auth",
|
||||
|
@@ -221,9 +221,11 @@ export async function saveServiceType(request: FastifyRequest<SaveServiceType>,
|
||||
let { id: variableId } = variable;
|
||||
if (variableId.startsWith('$$secret_')) {
|
||||
if (variable.defaultValue === '$$generate_password') {
|
||||
variable.value = generatePassword({});
|
||||
const length = variable?.details['length'] || null
|
||||
variable.value = generatePassword({length});
|
||||
} else if (variable.defaultValue === '$$generate_passphrase') {
|
||||
variable.value = cuid();
|
||||
const length = variable?.details['length'] || null
|
||||
variable.value = generatePassword({length});
|
||||
}
|
||||
}
|
||||
if (variableId.startsWith('$$config_')) {
|
||||
|
Reference in New Issue
Block a user