aboutsummaryrefslogtreecommitdiff
path: root/src/server/index.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-09-26 22:17:15 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-09-26 22:17:15 -0400
commit20540a35be82c34cc3962de4f957d1aa43f8a2b0 (patch)
treea4d67686a1d323bab947fcf3a6d6c2575b576c3e /src/server/index.ts
parente95387732e1fbff49ec035c3bec4b03324d814c8 (diff)
finally transferred google credential management to database
Diffstat (limited to 'src/server/index.ts')
-rw-r--r--src/server/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/index.ts b/src/server/index.ts
index 2ff63ab78..33d098e2c 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -824,7 +824,7 @@ app.post(RouteStore.googleDocs + "/:sector/:action", (req, res) => {
});
});
-app.get(RouteStore.googlePhotosAccessToken, (req, res) => GoogleApiServerUtils.RetrieveAccessToken({ credentialsPath, userId: req.headers.userId as string }).then(token => res.send(token)));
+app.get(RouteStore.googlePhotosAccessToken, (req, res) => GoogleApiServerUtils.RetrieveAccessToken({ credentialsPath, userId: req.header("userId")! }).then(token => res.send(token)));
const tokenError = "Unable to successfully upload bytes for all images!";
const mediaError = "Unable to convert all uploaded bytes to media items!";
@@ -839,9 +839,9 @@ export interface NewMediaItem {
app.post(RouteStore.googlePhotosMediaUpload, async (req, res) => {
const { media } = req.body;
- const { userId } = req.headers;
+ const userId = req.header("userId");
- if (!userId || Array.isArray(userId)) {
+ if (!userId) {
return _error(res, userIdError);
}