0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

modules/client/logout: Complete the logout endpoint.

This commit is contained in:
Jason Volk 2019-02-18 11:04:11 -08:00
parent f0ce1cdcae
commit cc2ed66190

View file

@ -34,6 +34,31 @@ post__logout(client &client, const resource::request &request)
request.access_token request.access_token
}; };
const m::room::state tokens
{
m::user::tokens
};
const auto token_event_idx
{
tokens.get("ircd.access_token", access_token)
};
const auto token_event_id
{
m::event_id(token_event_idx)
};
static const string_view reason
{
"logout"
};
const auto redaction_event_id
{
m::redact(m::user::tokens, request.user_id, token_event_id, reason)
};
return resource::response return resource::response
{ {
client, http::OK client, http::OK