Back

Having problem with deleting a session.

  • 0
  • Auth
  • Web
  • REST API
  • Cloud
Vignesh
29 Apr, 2024, 16:16

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 } }

TL;DR
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.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more