Can you double check that the project ID for the deployed app matches the one where you have added the platform?
[SOLVED] CORS No "Access-Control-Allow-Origin" header error
Votes
0
Replies
24
Participants
Unknown
Messages
25
Moderator
Are you using OAuth2 as authentication method?
Rank 1: Thread
I have only one project in appwrite right now
Rank 1: Thread
ah, no
It looks like the account sdk was enable to get the project ID.
How have you set the client and account SDK?
Can you share the code?
Rank 1: Thread
i'm just using the account.create endpoint to register new users
Rank 1: Thread
yeah, here
Rank 1: Thread
Mmm
It looks like it should work
Rank 1: Thread
i did write a function for auth using google, which i just removed
Rank 1: Thread
Let me see if it works now
Rank 1: Thread
Yeah, still gives the same error
Here https://github.com/SazedWorldbringer/spotify-tinder-thingy/blob/main/src/lib/utils.js
You're loading your project ID.
But the project ID is no in your exported JSON
{ "spotifyClient": "01606d0148544ec685aeb269e5ae8365", "endpoint" : "https://cloud.appwrite.io/v1", "project" : {}.VITE_APPWRITE_PROJECT, "collectionID" : "64775749e643228ccb38", "databaseID" : "64775708cd6262fb6f60", "apiKey" : {}.VITE_APPWRITE_API_KEY}So, first double check your .env file for the VITE_APPWRITE_PROJECT variable.
Second, it's best not to use an apiKey in client code.
Rank 1: Thread
Hey
Rank 1: Thread
sorry i'm responding this late
Rank 1: Thread
and thank you! i just hadn't set a project id env variable in vercel
Rank 1: Thread
also, i'll remember to not use api key in client code, thank you!
👍
So it worked?
Rank 1: Thread
yup, auth now works from the hosted version of the app
Admin
[SOLVED] CORS No "Access-Control-Allow-Origin" header error