diff options
Diffstat (limited to 'src/server/ApiManagers/SessionManager.ts')
-rw-r--r-- | src/server/ApiManagers/SessionManager.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/server/ApiManagers/SessionManager.ts b/src/server/ApiManagers/SessionManager.ts index c993c985f..bcaa6598f 100644 --- a/src/server/ApiManagers/SessionManager.ts +++ b/src/server/ApiManagers/SessionManager.ts @@ -2,7 +2,7 @@ import ApiManager, { Registration } from "./ApiManager"; import { Method, _permission_denied, AuthorizedCore, SecureHandler } from "../RouteManager"; import RouteSubscriber from "../RouteSubscriber"; import { sessionAgent } from ".."; -// import { DashSessionAgent } from "../DashSession/DashSessionAgent"; +import { DashSessionAgent } from "../DashSession/DashSessionAgent"; const permissionError = "You are not authorized!"; @@ -25,15 +25,15 @@ export default class SessionManager extends ApiManager { protected initialize(register: Registration): void { - // register({ - // method: Method.GET, - // subscription: this.secureSubscriber("debug", "to?"), - // secureHandler: this.authorizedAction(async ({ req: { params }, res }) => { - // const to = params.to || DashSessionAgent.notificationRecipient; - // const { error } = await sessionAgent.serverWorker.emit("debug", { to }); - // res.send(error ? error.message : `Your request was successful: the server captured and compressed (but did not save) a new back up. It was sent to ${to}.`); - // }) - // }); + register({ + method: Method.GET, + subscription: this.secureSubscriber("debug", "to?"), + secureHandler: this.authorizedAction(async ({ req: { params }, res }) => { + const to = params.to || DashSessionAgent.notificationRecipient; + const { error } = await sessionAgent.serverWorker.emit("debug", { to }); + res.send(error ? error.message : `Your request was successful: the server captured and compressed (but did not save) a new back up. It was sent to ${to}.`); + }) + }); register({ method: Method.GET, |