Trying to create a google OAuth for a nextjs app, the method call looks like this:
TypeScript
account.createOAuth2Session("google", "http://localhost:3000/dashboard","http://localhost:3000")
}}```
and getting this error: `Argument of type '"google"' is not assignable to parameter of type 'OAuthProvider'`
TL;DR
Developers are experiencing an issue with Google OAuth in a Next.js app. The error suggests a type mismatch in the method call. The solution is to check the version of the SDK being used and hosting details. The method call should be `account.createOAuth2Session(OAuthProvider.GOOGLE, "http://localhost:3000/dashboard", "http://localhost:3000")`.What version of the sdk are you using, and are you self hosted or cloud?
Recommended threads
- Getting CORS error when accessing websit...
When accessing my website I'm getting: (index):1 Access to font at 'https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2' from origin 'https://mvp-site-ra...
- How to ByPass the Hostname restriction f...
Hello, Im hosting my React application in a stateless server environment, where the IP of the client keeps changing for the server. How do I bypass the hostname...
- Email templates partially broken in non-...
Good afternoon! Non-english locales are missing some variables introduced in recent releases. That makes the sent emails look bad. The issue has been raised a...