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
- Added Custom Domain - API requests with ...
I've added in a custom domain to Appwrite my domain itself is on cloudflare but has Appwrite name servers added and confirmed they work, I added the CAA in clou...
- Custom Email Templates Not Updating for ...
I have 4 custom email templates on my self-hosted Appwrite instance: - email verification - reset password - security alert - 2FA verification. email verifica...
- Bug Report: type generation for enum of ...
### 👟 Reproduction steps in the enum element value, instead of English, use another language (Khmer), in my case Khmer text. ``` export enum ProvinceType { ...