1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Fixing enforced user loading. Fixes #677

This commit is contained in:
Patrik J. Braun 2023-08-03 00:33:18 +02:00
parent c39c1d7d99
commit 3e6bb7bff7
2 changed files with 4 additions and 1 deletions

View File

@ -56,6 +56,9 @@ const isTesting = ['afterEach', 'after', 'beforeEach', 'before', 'describe', 'it
uc.encrypted = !!uc.encryptedPassword;
changed = true;
}
if (!uc.encrypted && !uc.password) {
throw new Error('Password error for enforced user: ' + uc.name);
}
}
if (changed) {
config.saveSync();

View File

@ -183,7 +183,6 @@ export class UserConfig {
@ConfigProperty<string, ServerConfig, TAGS>({
type: 'string',
constraint: {assert: (val: string, config) => !!val, assertReason: 'Password cant be empty'},
tags:
{
name: $localize`Password`,
@ -193,6 +192,7 @@ export class UserConfig {
description: $localize`Unencrypted, temporary password. App will encrypt it and delete this.`
})
password: string;
@ConfigProperty({
tags:
{