Hey I am trying to follow the react tutorial and im on the first section of creating a login page everything worked fine but when logging out im being met with the cors error. I have added a platform with localhost as the name and I even tried * wildcard but the logout will not work due to cors can anyone assist please
this is what I am using
await account.deleteSession('current'); setLoggedInUser(null);
Just would love to get this sorted as I'm trying to develop ui to advertise my skills
I’m pretty sure we’ve seen this before, but I don’t remember (and I can’t find rn) if or how it was resolved
thats not a problem I appreciate the help its just strange how Ive followed the steps on your tutorial and the youtube channel to avoid cors and only the deletesessions() is not working for me
i get the user sessions but when it comes to deleting the session for loging out purpose it fails
Yeah, I’ve seen that happen specifically with deleting sessions in the past
I have tried to do variations of the delete session but unfortunately nothing I have tried testing the rest via postman but get a user role error
You won’t be able to hit the deleteSession()
endpoint in Postman without having an active session there.
okay I ses so this is redundant unless I can get the active session
One odd thing is I don't see the project in the headers 🧐
What was the result of the other request that failed?
It is very strange is there a step I'm missing cause I'm following the documents step by step
Where am I suppose to put the project in the headers I can share my code
I think that might just be because that’s the preflight, not the actual request
I would still expect it to have the project header
You're supposed to call setProject()
I do have the setProject in the config file but I found another document where I will give that a try
@\geekdev You can see the Project header is present here
I've tried this doc to try a new approach but still issues when it comes to the logout
access-control-allow-methods: * which I am using as a wildcard for the platform aswell as local host so would I need to manually write that in the code to by pass this
https://appwrite.io/blog/post/handle-cors-in-serverless-functions im referencing this
issue appears to have been resolved I believe it was due to my extension
Oh yes! Now I remember - the last time this came up it was a browser extension too!
If your issue has been solved, you can mark this post as closed by adding "[SOLVED]" to the beginning of the title
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...