aboutsummaryrefslogtreecommitdiff
path: root/src/server/apis/google/GoogleApiServerUtils.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-03 01:46:36 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-12-03 01:46:36 -0500
commitef94ad7df2a087141ddb8d347d3e3c484ff7609b (patch)
treea7c16be04ff4050da1ff03e02f59df6da4f5f7e2 /src/server/apis/google/GoogleApiServerUtils.ts
parent62c888ad25c5580441eaf947a1a0f1638939b868 (diff)
const linter rule and restored google docs push, fixed routing
Diffstat (limited to 'src/server/apis/google/GoogleApiServerUtils.ts')
-rw-r--r--src/server/apis/google/GoogleApiServerUtils.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/apis/google/GoogleApiServerUtils.ts b/src/server/apis/google/GoogleApiServerUtils.ts
index b0f3ba993..329107a71 100644
--- a/src/server/apis/google/GoogleApiServerUtils.ts
+++ b/src/server/apis/google/GoogleApiServerUtils.ts
@@ -135,7 +135,7 @@ export namespace GoogleApiServerUtils {
return resolve();
}
let routed: Opt<Endpoint>;
- let parameters: any = { auth, version: "v1" };
+ const parameters: any = { auth, version: "v1" };
switch (sector) {
case Service.Documents:
routed = google.docs(parameters).documents;
@@ -318,7 +318,7 @@ export namespace GoogleApiServerUtils {
*/
async function retrieveCredentials(userId: string): Promise<{ credentials: Opt<Credentials>, refreshed: boolean }> {
let credentials: Opt<Credentials> = await Database.Auxiliary.GoogleAuthenticationToken.Fetch(userId);
- let refreshed = false;
+ const refreshed = false;
if (!credentials) {
return { credentials: undefined, refreshed };
}
@@ -340,9 +340,9 @@ export namespace GoogleApiServerUtils {
* @returns the updated credentials
*/
async function refreshAccessToken(credentials: Credentials, userId: string): Promise<Credentials> {
- let headerParameters = { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } };
+ const headerParameters = { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } };
const { client_id, client_secret } = GoogleCredentialsLoader.ProjectCredentials;
- let url = `https://oauth2.googleapis.com/token?${qs.stringify({
+ const url = `https://oauth2.googleapis.com/token?${qs.stringify({
refreshToken: credentials.refresh_token,
client_id,
client_secret,