I have configured my domain name with Cloudflare DNS and obtained a free SSL certificate from Cloudflare. I've set up this domain as an endpoint in my Appwrite dashboard, and everything seems to be working fine. However, I keep encountering a warning message in my console whenever I run my app: 'Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.' Should I be worried about this warning, and does it impact my security? Despite this, Appwrite doesn't seem to accept my domain name as a custom domain. What steps can I take to resolve this issue and properly configure my Appwrite endpoint with my domain?"
Hi
The warning suggests that using localStorage for session management isn't the most secure method when compared to using HTTP cookies with the HttpOnly attribute. When a session is stored in localStorage, it's accessible by any JavaScript running on your page, which can make it vulnerable to XSS attacks.
Appwrite prefers to use more secure methods for session management, like HTTP cookies. However, to set cookies from Appwrite to your frontend, both need to be on the same domain or subdomain. This isn't possible when you're not using a custom domain with Appwrite, so Appwrite falls back to using localStorage.
So, it is much better to use custom domain
Now for the second part of the question:
Custom Domain Setup: If you've already configured your domain with Appwrite, make sure you've set it up correctly. This includes updating the DNS records, ensuring SSL works properly, and configuring your Appwrite environment to use your custom domain.
CORS & Appwrite Console: In the Appwrite console, ensure that you've added your custom domain under the settings section to allow requests from your frontend domain.
We have details on this page about everything related to custom domains, can you please read them once? https://appwrite.io/docs/custom-domains
@joeyouss Hi there I believe there might be an issue with Cloudflare's service. I followed the custom domain configuration instructions precisely as outlined in the documentation you provided earlier. However, despite my endpoint URL functioning properly behind Cloudflare, the dashboard is still presenting an error message that reads: 'Domain verification for the requested domain has failed.'
Setup Custom Domains for domain name behind Cloudflare dns
It might be due to the fact your server don't use SSL before <:cloudflare:1026272852900581496> Cloudflare. Check this: https://book.appread.io/post-installation#cloudflare-other-https-on-dns-level
@Binyamin Thanks that article helped me alot :appwritepeepo:
[SOLVED] Setup Custom Domains for domain name behind Cloudflare dns
Recommended threads
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...