mirror of
https://github.com/unraid/api.git
synced 2026-01-01 06:01:18 -06:00
fix: properly log error with template string
This commit is contained in:
@@ -7,6 +7,7 @@ import { addSsoUser, loadConfigFile } from '@app/store/modules/config';
|
|||||||
import { writeConfigSync } from '@app/store/sync/config-disk-sync';
|
import { writeConfigSync } from '@app/store/sync/config-disk-sync';
|
||||||
import { LogService } from '@app/unraid-api/cli/log.service';
|
import { LogService } from '@app/unraid-api/cli/log.service';
|
||||||
import { AddSSOUserQuestionSet } from '@app/unraid-api/cli/sso/add-sso-user.questions';
|
import { AddSSOUserQuestionSet } from '@app/unraid-api/cli/sso/add-sso-user.questions';
|
||||||
|
import { v4 } from 'uuid';
|
||||||
|
|
||||||
interface AddSSOUserCommandOptions {
|
interface AddSSOUserCommandOptions {
|
||||||
disclaimer: string;
|
disclaimer: string;
|
||||||
@@ -53,7 +54,7 @@ export class AddSSOUserCommand extends CommandRunner {
|
|||||||
if (
|
if (
|
||||||
!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(input)
|
!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(input)
|
||||||
) {
|
) {
|
||||||
throw new Error('Username must be in the format of a UUID (e.g., ${v4()}}\n');
|
throw new Error(`Username must be in the format of a UUID (e.g., ${v4()}}\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return input;
|
return input;
|
||||||
|
|||||||
Reference in New Issue
Block a user