terms
terms7mo ago

Passing down additional params during user signup using OAuth provider

Is there a way to pass down additional params to be written using await signIn("google")? I'm aware of the afterUserCreatedOrUpdated method but that callback won't receive the params passed from signIn. Additionally, is there a way of removing phone, phoneVerificationTime, isAnonymous, and image fields? These fields aren't relevant to my application.
6 Replies
Convex Bot
Convex Bot7mo ago
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!
ballingt
ballingt7mo ago
OAuth - Convex Auth
Authentication library for your Convex backend
ian
ian7mo ago
And you can fully own the user table creation / updating / fields by implementing the createOrUpdateUser function: https://labs.convex.dev/auth/advanced#controlling-user-creation-and-account-linking-behavior which avoids needing to add those fields
Advanced: Details - Convex Auth
Authentication library for your Convex backend
David Alonso
David Alonso7mo ago
One thing I've missed when trying to override this function that would be really helpful in the docs potentially... https://discord.com/channels/1019350475847499849/1341675738751045686
Bruno Prado
Bruno Prado2w ago
I think the OP wanted the same thing I need right now. When sending an invitation for a user (a link for example), I wanted to grab the params from the URL and pass down the signIn flow even if the user uses OAuth to do it. When using Google OAuth, we cannot pass any additional information to the auth.ts backend. This is really frustrating. For now, I won't allow Google OAuth for a specific kind of user.
ian
ian2w ago
I wonder how easy it is to register your own webhook / action and do the custom logic, then call the associated Convex Auth function. Ultimately all calls flow through your backend, and just happen to be the ones exported / registered by convex auth. I haven't looked at the code in a while though, so it'd take some logging / investigating to know. I agree this is a shortcoming, and I personally also want this

Did you find this page helpful?