aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-01-11 15:19:06 -0500
committerSam Wilkins <samwilkins333@gmail.com>2020-01-11 15:19:06 -0500
commit791499af4f474fe8ec7863ab9fe7b5b1120ac5ce (patch)
tree879928036abeed1d61ed26f86321415c92c3b098 /src
parent54a241ff71abc07a5dbdebce1b614f1024a767e6 (diff)
small changes
Diffstat (limited to 'src')
-rw-r--r--src/server/ApiManagers/SessionManager.ts12
-rw-r--r--src/server/DashSession/DashSessionAgent.ts2
2 files changed, 6 insertions, 8 deletions
diff --git a/src/server/ApiManagers/SessionManager.ts b/src/server/ApiManagers/SessionManager.ts
index d989d8d1b..1816d492d 100644
--- a/src/server/ApiManagers/SessionManager.ts
+++ b/src/server/ApiManagers/SessionManager.ts
@@ -29,15 +29,13 @@ export default class SessionManager extends ApiManager {
register({
method: Method.GET,
subscription: this.secureSubscriber("debug", "mode?", "recipient?"),
- secureHandler: this.authorizedAction(async ({ req, res }) => {
- const { mode, recipient } = req.params;
- if (mode && !["passive", "active"].includes(mode)) {
+ secureHandler: this.authorizedAction(async ({ req: { params }, res }) => {
+ const mode = params.mode || "active";
+ const recipient = params.recipient || DashSessionAgent.notificationRecipient;
+ if (!["passive", "active"].includes(mode)) {
res.send(`Your request failed. '${mode}' is not a valid mode: please choose either 'active' or 'passive'`);
} else {
- const response = await sessionAgent.serverWorker.emitToMonitorPromise("debug", {
- mode: mode || "active",
- recipient: recipient || DashSessionAgent.notificationRecipient
- });
+ const response = await sessionAgent.serverWorker.emitToMonitorPromise("debug", { mode, recipient });
if (response instanceof Error) {
res.send(response);
} else {
diff --git a/src/server/DashSession/DashSessionAgent.ts b/src/server/DashSession/DashSessionAgent.ts
index fe7cdae88..a688f2909 100644
--- a/src/server/DashSession/DashSessionAgent.ts
+++ b/src/server/DashSession/DashSessionAgent.ts
@@ -88,7 +88,7 @@ export class DashSessionAgent extends AppliedSessionAgent {
const error = await Email.dispatch({
to: notificationRecipient,
subject: "Dash Release Session Admin Authentication Key",
- content: `Here's the key for this session (started @ ${new Date().toUTCString()}):\n\n${sessionKey}.\n\n${this.signature}`
+ content: `Here's the key for this session (started @ ${new Date().toUTCString()}):\n\n${sessionKey}\n\n${this.signature}`
});
if (error) {
this.sessionMonitor.mainLog(red(`dispatch failure @ ${notificationRecipient} (${yellow(error.message)})`));