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

Pass additional params to OAuth provider to be used in signIn callback #303

Closed
joneath opened this issue Apr 3, 2023 · 1 comment
Closed

Comments

@joneath
Copy link

joneath commented Apr 3, 2023

Ask your question

I need to pass a property (inviteToken) from the frontend's signIn request to the OAuth provider (Google in my case) and then use this property in the backend's signIn callback. As you can see from the method signature of signIn it says the second param will be be passed with the body of the sign-in request:
Screenshot 2023-04-03 at 15 29 54

That seems to only work for the credentials provider...no problem because the third param says it will be passed along as the authorizationParams to the provider. Using this param I can send my inviteToken to Google's side and I see it included in the callbackUrl so I know it's getting passed back to my system but these custom authorizationParams seem to be dropped by Nuxt/Nextjs Auth as the account, credentials, profile, and user objects in the signIn callback don't include my inviteToken. Here in the next-auth repo you can see them working out the temporary solution of using cookies to store any data pre-auth to be used in/post auth. I can easily do this on the frontend but not inside of any of the callbacks of NuxtAuthHandler because we're not provided with the H3 event 😞. Any thoughts on a solution?

Additional information

No response

@BracketJohn
Copy link
Contributor

Thanks @joneath for the question + the good description of it + treying out so much already.

Sadly, I cannot get around it right now but will leave it open for others to hopefully share some info. Have you figured out something in the meantime?

@sidebase sidebase locked and limited conversation to collaborators May 14, 2023
@BracketJohn BracketJohn converted this issue into discussion #388 May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants