
I'm developing my Godot game using Apwwrite. I use Appwrite's REST API. I can login successfully and retrieve a session id but when I call delete session and attaching the session_id in the headers and endpoint I'm getting the following error: {"message":"User (role: guests) missing scope (account)","code":401,"type":"general_unauthorized_scope","version":"1.6.2"}
This is my function in GDScript: func logout(session_token: String) -> void: print("[UserNetwork] Attempting to delete all sessions")
var headers = [
"X-Appwrite-Response-Format: 1.6.0",
"X-Appwrite-Project: " + _PROJECT_ID,
"Content-Type: application/json",
"X-Appwrite-Session: " + session_token,
]
print("[UserNetwork] Headers for logout: ", headers)
var network_request = NetworkRequest.new()
network_request.set_url(_APPWRITE_ENDPOINT + "/account/sessions/" + session_token)
network_request.set_method(HTTPClient.METHOD_DELETE)
network_request.set_headers(headers)
var client = HTTPClient.new()
_network.execute(client, network_request, _on_logout_result)
func _on_logout_result(request_id: String, response_body, response_code, response_attached_params): print("[UserNetwork] Logout response received. Status code: ", response_code) print("[UserNetwork] Response body: ", response_body)
if response_code == 204:
_session_id_changes.on_next("")
_is_logged_in.Value = false
print("[UserNetwork] Logout successful")
else:
print("[UserNetwork] Logout failed with status code: ", response_code)
Basically I don't know how to make Appwrite recognize that the session id is associated with a valid user. Thanks in advance!
Recommended threads
- Appwrite stopped working, I can't authen...
I'm having an issue with Appwrite. It was working fine just a while ago, but suddenly it stopped working for me and can't authenticate accounts. I even went bac...
- Set succes/failure url in console
Hi guys, I want to set up a succes and failure url for my OAuth2 provider Google. But I don't see any options for this? Is it not possible to do so? Beside th...
- Fail to receive the verification email a...
I added my email address to prevent it from showing "appwrite," but now I'm not receiving emails for verification or password resets. The function appears to be...
