convex google oauth issue
I configured the google oauth in the providers, but got an error.
providers: [
GitHub({
profile(githubProfile) {
return {
id: githubProfile.id.toString(),
};
},
}),
Google({
profile(googleProfile) {
console.log("googleProfile", googleProfile);
return {
id: googleProfile.id?.toString(),
};
},
}),
],
error: 'The profile method of the google config must return a string ID
But in googleprofile, there is no such id returned.3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
example google profile:
'googleProfile' {
iss: 'https://accounts.google.com',
azp: '9529a73vbu.apps.googleusercontent.com',
aud: '95pps.googleusercontent.com',
sub: '1038559659',
email: 'chriom',
email_verified: true,
at_hash: 'ySSww',
name: 'Chr',
picture: 'https://lh3.googleuserccom/a/ACg8ocL7LcDPg1XJj6-c',
given_name: 'Chris',
family_name: 'Li',
iat: 1732652236,
exp: 1732655836
}
I believe this is the default
profile
implementation -- https://github.com/get-convex/convex-auth/blob/9ada6e7270d1eb09aead128a8af2be1e32fd0a13/src/server/provider_utils.ts#L107
So if you want a custom one, you likely want to still have the same logic for returning id
GitHub
convex-auth/src/server/provider_utils.ts at 9ada6e7270d1eb09aead128...
Library for built-in auth. Contribute to get-convex/convex-auth development by creating an account on GitHub.