-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Reduce bundle size via better imports + install gcal + gvideo b…
…y default for google signups (#17810) * wip * use light imports * fix * perf: Reduce bundle size via better imports with `googleapis` (#17811) * fix test * refactor * update vite.config.js * fix * fix unit test failing
- Loading branch information
Showing
27 changed files
with
379 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/app-store/_utils/oauth/updateProfilePhotoGoogle.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { oauth2_v2 } from "@googleapis/oauth2"; | ||
import type { OAuth2Client } from "googleapis-common"; | ||
|
||
import logger from "@calcom/lib/logger"; | ||
import { UserRepository } from "@calcom/lib/server/repository/user"; | ||
|
||
export async function updateProfilePhotoGoogle(oAuth2Client: OAuth2Client, userId: number) { | ||
try { | ||
const oauth2 = new oauth2_v2.Oauth2({ auth: oAuth2Client }); | ||
const userDetails = await oauth2.userinfo.get(); | ||
if (userDetails.data?.picture) { | ||
await UserRepository.updateAvatar({ id: userId, avatarUrl: userDetails.data.picture }); | ||
} | ||
} catch (error) { | ||
logger.error("Error updating avatarUrl from google calendar connect", error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.