refactor(admin-dashboard, nginx): normalize multiline formatting in Serve.ts, NginxConfigurator.ts and WriteServerCertToDisk.ts

This commit is contained in:
Nawaz Dhandala
2025-11-04 20:39:53 +00:00
parent 9a1ecd7fe0
commit d2ee3c5409
3 changed files with 19 additions and 13 deletions

View File

@@ -35,7 +35,9 @@ const ensureMasterAdminAccess: EnsureMasterAdminAccessFunction = async (
Response.sendErrorResponse(
req,
res,
new NotAuthorizedException("Unauthorized: Only master admins can access the admin dashboard."),
new NotAuthorizedException(
"Unauthorized: Only master admins can access the admin dashboard.",
),
);
return {};
}
@@ -46,7 +48,9 @@ const ensureMasterAdminAccess: EnsureMasterAdminAccessFunction = async (
Response.sendErrorResponse(
req,
res,
new NotAuthorizedException("Unauthorized: Only master admins can access the admin dashboard."),
new NotAuthorizedException(
"Unauthorized: Only master admins can access the admin dashboard.",
),
);
return {};
}
@@ -57,7 +61,9 @@ const ensureMasterAdminAccess: EnsureMasterAdminAccessFunction = async (
Response.sendErrorResponse(
req,
res,
new NotAuthorizedException("Unauthorized: Only master admins can access the admin dashboard."),
new NotAuthorizedException(
"Unauthorized: Only master admins can access the admin dashboard.",
),
);
return {};
}

View File

@@ -77,10 +77,11 @@ export default class WriteServerCertToDiskJob {
(await LocalFile.doesFileExist(certificatePath))
? await LocalFile.read(certificatePath)
: null;
const existingKey: string | null =
(await LocalFile.doesFileExist(keyPath))
? await LocalFile.read(keyPath)
: null;
const existingKey: string | null = (await LocalFile.doesFileExist(
keyPath,
))
? await LocalFile.read(keyPath)
: null;
const certificateChanged: boolean =
existingCertificate !== certificatePem ||

View File

@@ -25,8 +25,7 @@ export default class NginxConfigurator {
return;
}
const certificateDirective: string =
`ssl_certificate /etc/nginx/certs/ServerCerts/${normalizedHost}.crt;`;
const certificateDirective: string = `ssl_certificate /etc/nginx/certs/ServerCerts/${normalizedHost}.crt;`;
let nginxConfig: string = "";
try {
@@ -38,11 +37,11 @@ export default class NginxConfigurator {
logger.debug(err);
}
const templateHasDirective: boolean = nginxConfig.includes(
certificateDirective,
);
const templateHasDirective: boolean =
nginxConfig.includes(certificateDirective);
const shouldRefreshTemplate: boolean = !templateHasDirective;
const shouldReload: boolean = options.forceReload === true || shouldRefreshTemplate;
const shouldReload: boolean =
options.forceReload === true || shouldRefreshTemplate;
if (!shouldReload) {
return;