resources
This commit is contained in:
@@ -106,6 +106,7 @@ integrationsRouter.get('/google/status', async (ctx) => {
|
||||
configured: !!(config?.clientId && config?.clientSecret),
|
||||
connected: !!connection?.accessToken,
|
||||
email: connection?.email ?? null,
|
||||
picture: connection?.picture ?? null,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -201,9 +202,11 @@ export const googleCallbackHandler = async (ctx: any) => {
|
||||
});
|
||||
|
||||
let googleEmail = email;
|
||||
let picture: string | null = null;
|
||||
if (userinfoResponse.ok) {
|
||||
const userinfo = await userinfoResponse.json();
|
||||
googleEmail = userinfo.email ?? email;
|
||||
picture = userinfo.picture ?? null;
|
||||
}
|
||||
|
||||
await writeUserGoogle(email, {
|
||||
@@ -211,6 +214,7 @@ export const googleCallbackHandler = async (ctx: any) => {
|
||||
refreshToken: tokens.refresh_token,
|
||||
expiresAt: Date.now() + tokens.expires_in * 1000,
|
||||
email: googleEmail,
|
||||
picture,
|
||||
scope: tokens.scope,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user