
I'm getting a CORS + 401 Error with Appwrite Authentication
Access to fetch at 'https://cloud.appwrite.io/v1/account/sessions/email' from origin 'https://my-custom-subdomain.appwrite.network' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. POST https://cloud.appwrite.io/v1/account/sessions/email net::ERR_FAILED 401 (Unauthorized)
Framework: Next.js 14 with Appwrite SDK
Authentication: Email/Password using account.createEmailPasswordSession()
Environment Variables:
NEXT_PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
NEXT_PUBLIC_APPWRITE_PROJECT_ID=my-project-id
My Integrations > Platforms
Name|Platform type|Identifier|Last updated
My Project Name|Web|my-custom-subdomain.appwrite.network|3 days ago
localhost|Web|—|A few seconds ago
It works well in localhost.
What I've tried
https://appwrite.io/blog/post/cors-error
So, how to fix it?
Recommended threads
- Exposing project id and endpoint on GitH...
Is it best practice to expose your project id and endpoint in your appwrite.js file when publishing an NextJS or Angular project. If you use a .env file, that i...
- File tokens regenerate each page reload
Hello, on appwrite 1.7.4, when I create a file token via the API Tokens(appwriteAdminClient)#createFileToken I get a secret, then when I check in the console t...
- CSV Import Shows Success but Data Not Ap...
I tried importing a CSV file into my PRODUCTS collection. The dashboard shows the message “Import to PRODUCTS completed successfully,” but no data appears in th...
