VigneshOriginal post
Web Developer
All the methods GET,POST etc are working but DELETE request is giving a CORS error while signing out the user.I have set the endpoint as localhost in appwrite web integration, but still having this issue.
My code is as below:
async logout(){
try {
const account = await this.account.deleteSession('current')
return account
} catch (error) {
console.log("Appwrite :: logout :: ", error);
throw error
}
}
Summary
Developers are experiencing CORS error when trying to delete a session with a DELETE request in their code. The endpoint is set to localhost in the appwrite web integration, but the issue persists. The logout function is shared in the code snippet provided.
Solution: To resolve the CORS error when deleting a session, ensure that the server allows DELETE requests from the localhost origin. Double-check CORS configurations on the server side.