Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAL-3036] prefill avatar when signing up with Google #13426

Closed
PeerRich opened this issue Jan 26, 2024 · 5 comments · Fixed by #13427
Closed

[CAL-3036] prefill avatar when signing up with Google #13426

PeerRich opened this issue Jan 26, 2024 · 5 comments · Fixed by #13427
Labels
community Created by Linear-GitHub Sync ✅ good first issue Good for newcomers 🙋🏻‍♂️help wanted Help from the community is appreciated Low priority Created by Linear-GitHub Sync ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work 💰 Rewarded Rewarded bounties on Algora.io
Milestone

Comments

@PeerRich
Copy link
Member

PeerRich commented Jan 26, 2024

example: https://github.com/dubinc/dub/blob/main/apps/web/lib/auth/options.ts#L195

CAL-3036

@PeerRich PeerRich changed the title prefill avatar when signing up with Google [CAL-3036] prefill avatar when signing up with Google Jan 26, 2024
@PeerRich PeerRich added ✅ good first issue Good for newcomers 🙋🏻‍♂️help wanted Help from the community is appreciated ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work labels Jan 26, 2024
@PeerRich
Copy link
Member Author

/bounty 20

@PeerRich PeerRich added this to the v3.8 milestone Jan 26, 2024
Copy link

algora-pbc bot commented Jan 26, 2024

💎 $20 bounty created by cal
👉 No need to comment asking to work on it. Just open a PR and claim the bounty with /claim #13426 inside the PR
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to calcom/cal.com!

👉 Add a bountyShare on socials

@algora-pbc algora-pbc bot added the 💎 Bounty A bounty on Algora.io label Jan 26, 2024
@PeerRich PeerRich added Low priority Created by Linear-GitHub Sync and removed 💎 Bounty A bounty on Algora.io labels Jan 26, 2024
Copy link

algora-pbc bot commented Jan 26, 2024

💡 @neo773 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

@PeerRich PeerRich added the community Created by Linear-GitHub Sync label Jan 26, 2024
Copy link

algora-pbc bot commented Jan 27, 2024

🎉🎈 @neo773 has been awarded $20! 🎈🎊

@algora-pbc algora-pbc bot added the 💰 Rewarded Rewarded bounties on Algora.io label Jan 27, 2024
@Rameshk84
Copy link

Here we need to change the code in of :- apps/web/lib/auth/options.ts

Here is the correct code Code 👨‍💻 :- For #13426

callbacks: {
signIn: async ({ user, account, profile }) => {
console.log({ user, account, profile });
if (!user.email || (await isBlacklistedEmail(user.email))) {
return false;
}

if (account?.provider === "google") {
  const userExists = await prisma.user.findUnique({
    where: { email: user.email },
    select: { name: true, image: true },
  });

  // If the user already exists via email and doesn't have a name or image,
  // update the user with their name and image from Google
  if (userExists && (!userExists.name || !userExists.image)) {
    await prisma.user.update({
      where: { email: user.email },
      data: {
        name: userExists.name || profile?.name || "",
        image: userExists.image || profile?.picture || "",
      },
    });
  }
}

return true;

},
// ... other callbacks
},

Rameshk84 added a commit to Rameshk84/cal.com that referenced this issue Jan 29, 2024
Issue Solved [CAL-3036] prefill avatar when signing up with Google calcom#13426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Created by Linear-GitHub Sync ✅ good first issue Good for newcomers 🙋🏻‍♂️help wanted Help from the community is appreciated Low priority Created by Linear-GitHub Sync ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work 💰 Rewarded Rewarded bounties on Algora.io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants