
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
- Appwrite Fra Cloud Custom Domains Issue
I’m trying to configure my custom domain appwrite.qnarweb.com (CNAME pointing to fra.cloud.appwrite.io with Cloudflare proxy disabled) but encountering a TLS ce...
- Appwrite service :: getCurrentUser :: Us...
Getting this error while creating a react app can someone please help me solve the error
- Storage & Database is not allowing.
Storage & Database is not allowing to CRUD after i have logged in ? Using web SDK with next.js without any SSR or node-sdk.
