diff options
| author | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-08-09 13:17:14 +0800 |
|---|---|---|
| committer | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-08-09 13:17:14 +0800 |
| commit | d5d4d642189886d646324cc74483c91983458585 (patch) | |
| tree | 975dd2c16137bb2167172883745f99d9e582fe07 /src/server/ApiManagers | |
| parent | ca8566598d2ae9c85b1ea9418fced7261a7f11e2 (diff) | |
| parent | 9f4a7ec5f79d9dec3a0ffb0b633197216cbefec8 (diff) | |
Merge branch 'master' into presentation_updates
Diffstat (limited to 'src/server/ApiManagers')
| -rw-r--r-- | src/server/ApiManagers/HypothesisManager.ts | 44 | ||||
| -rw-r--r-- | src/server/ApiManagers/UploadManager.ts | 1 |
2 files changed, 0 insertions, 45 deletions
diff --git a/src/server/ApiManagers/HypothesisManager.ts b/src/server/ApiManagers/HypothesisManager.ts deleted file mode 100644 index 33badbc42..000000000 --- a/src/server/ApiManagers/HypothesisManager.ts +++ /dev/null @@ -1,44 +0,0 @@ -import ApiManager, { Registration } from "./ApiManager"; -import { Method, _permission_denied } from "../RouteManager"; -import { GoogleApiServerUtils } from "../apis/google/GoogleApiServerUtils"; -import { Database } from "../database"; -import { writeFile, readFile, readFileSync, existsSync } from "fs"; -import { serverPathToFile, Directory } from "./UploadManager"; - -export default class HypothesisManager extends ApiManager { - - protected initialize(register: Registration): void { - - register({ - method: Method.GET, - subscription: "/readHypothesisAccessToken", - secureHandler: async ({ user, res }) => { - if (existsSync(serverPathToFile(Directory.hypothesis, user.id))) { - const read = readFileSync(serverPathToFile(Directory.hypothesis, user.id), "base64") || ""; - console.log("READ = " + read); - res.send(read); - } else res.send(""); - } - }); - - register({ - method: Method.POST, - subscription: "/writeHypothesisAccessToken", - secureHandler: async ({ user, req, res }) => { - const write = req.body.authenticationCode; - console.log("WRITE = " + write); - res.send(await writeFile(serverPathToFile(Directory.hypothesis, user.id), write, "base64", () => { })); - } - }); - - register({ - method: Method.GET, - subscription: "/revokeHypothesisAccessToken", - secureHandler: async ({ user, res }) => { - await Database.Auxiliary.GoogleAccessToken.Revoke("dash-hyp-" + user.id); - res.send(); - } - }); - - } -}
\ No newline at end of file diff --git a/src/server/ApiManagers/UploadManager.ts b/src/server/ApiManagers/UploadManager.ts index 515fbe4ff..bd8fe97eb 100644 --- a/src/server/ApiManagers/UploadManager.ts +++ b/src/server/ApiManagers/UploadManager.ts @@ -25,7 +25,6 @@ export enum Directory { text = "text", pdf_thumbnails = "pdf_thumbnails", audio = "audio", - hypothesis = "hypothesis" } export function serverPathToFile(directory: Directory, filename: string) { |
