aboutsummaryrefslogtreecommitdiff
path: root/src/server/ApiManagers/GeneralGoogleManager.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2020-01-06 09:42:11 -0500
committerbob <bcz@cs.brown.edu>2020-01-06 09:42:11 -0500
commitdf12bd5432f24796de25f9aa85e278eae944edf7 (patch)
treea3d4916891e0b6860e18c547cbdb23fcb620e947 /src/server/ApiManagers/GeneralGoogleManager.ts
parent8ae1d973896f8629e5d2030f756b7b63df530ad2 (diff)
parente4d9fd09f6ede20e79d58119d239bb7a3a7dae25 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/server/ApiManagers/GeneralGoogleManager.ts')
-rw-r--r--src/server/ApiManagers/GeneralGoogleManager.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/ApiManagers/GeneralGoogleManager.ts b/src/server/ApiManagers/GeneralGoogleManager.ts
index 3617779d5..a5240edbc 100644
--- a/src/server/ApiManagers/GeneralGoogleManager.ts
+++ b/src/server/ApiManagers/GeneralGoogleManager.ts
@@ -19,7 +19,7 @@ export default class GeneralGoogleManager extends ApiManager {
register({
method: Method.GET,
subscription: "/readGoogleAccessToken",
- onValidation: async ({ user, res }) => {
+ secureHandler: async ({ user, res }) => {
const token = await GoogleApiServerUtils.retrieveAccessToken(user.id);
if (!token) {
return res.send(GoogleApiServerUtils.generateAuthenticationUrl());
@@ -31,7 +31,7 @@ export default class GeneralGoogleManager extends ApiManager {
register({
method: Method.POST,
subscription: "/writeGoogleAccessToken",
- onValidation: async ({ user, req, res }) => {
+ secureHandler: async ({ user, req, res }) => {
res.send(await GoogleApiServerUtils.processNewUser(user.id, req.body.authenticationCode));
}
});
@@ -39,7 +39,7 @@ export default class GeneralGoogleManager extends ApiManager {
register({
method: Method.POST,
subscription: new RouteSubscriber("googleDocs").add("sector", "action"),
- onValidation: async ({ req, res, user }) => {
+ secureHandler: async ({ req, res, user }) => {
const sector: GoogleApiServerUtils.Service = req.params.sector as GoogleApiServerUtils.Service;
const action: GoogleApiServerUtils.Action = req.params.action as GoogleApiServerUtils.Action;
const endpoint = await GoogleApiServerUtils.GetEndpoint(GoogleApiServerUtils.Service[sector], user.id);