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
- Rate limit
How do I solve "Signup Failed, Rate limit for the current endpoint has been exceeded. Please try again after some time"? I have Pro and around 2k requests per ...
- Type 'Theme' does not satisfy the constr...
Type 'Theme' does not satisfy the constraint 'Row'. Type 'Theme' is missing the following properties from type 'Row': $id, $sequence, $tableId, $databaseId, a...
- Custom Domain TLS Error (perfinso.com)
Hey Appwrite team/community, I need urgent help with a custom domain setup! I've added perfinso.com to my project, pointed the nameservers, and verification is...