diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-10-12 19:13:25 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-10-12 19:13:25 -0400 |
commit | 5b83d8da6c262897dc75ada26f08ed1c46ceb95c (patch) | |
tree | a9770d9b9b3520712f12fb099a99b32cad8f14d0 /src/server/database.ts | |
parent | d7653cab93309717488d51c68c8b1f0db64b949c (diff) |
parse google user data and use it to provide customized feedback on login
Diffstat (limited to 'src/server/database.ts')
-rw-r--r-- | src/server/database.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/database.ts b/src/server/database.ts index 990441d5a..db86b472d 100644 --- a/src/server/database.ts +++ b/src/server/database.ts @@ -4,6 +4,7 @@ import { Opt } from '../new_fields/Doc'; import { Utils, emptyFunction } from '../Utils'; import { DashUploadUtils } from './DashUploadUtils'; import { Credentials } from 'google-auth-library'; +import { GoogleApiServerUtils } from './apis/google/GoogleApiServerUtils'; export namespace Database { @@ -259,8 +260,8 @@ export namespace Database { return SanitizedSingletonQuery<StoredCredentials>({ userId }, GoogleAuthentication, removeId); }; - export const Write = async (userId: string, token: any) => { - return Instance.insert({ userId, canAccess: [], ...token }, GoogleAuthentication); + export const Write = async (userId: string, enrichedCredentials: GoogleApiServerUtils.EnrichedCredentials) => { + return Instance.insert({ userId, canAccess: [], ...enrichedCredentials }, GoogleAuthentication); }; export const Update = async (userId: string, access_token: string, expiry_date: number) => { |