ruma_identity_service_api/authentication/logout.rs
1//! `POST /_matrix/identity/*/account/logout`
2//!
3//! Logs out the access token, preventing it from being used to authenticate future requests to the
4//! server.
5
6pub mod v2 {
7 //! `/v2/` ([spec])
8 //!
9 //! [spec]: https://spec.matrix.org/v1.19/identity-service-api/#post_matrixidentityv2accountlogout
10
11 use ruma_common::{
12 api::{request, response},
13 metadata,
14 };
15
16 use crate::IdentityServiceToken;
17
18 metadata! {
19 method: POST,
20 rate_limited: false,
21 authentication: IdentityServiceToken,
22 history: {
23 1.0 => "/_matrix/identity/v2/account/logout",
24 }
25 }
26
27 /// Request type for the `logout` endpoint.
28 #[request]
29 #[derive(Default)]
30 pub struct Request {}
31
32 /// Response type for the `logout` endpoint.
33 #[response]
34 #[derive(Default)]
35 pub struct Response {}
36
37 impl Request {
38 /// Creates an empty `Request`.
39 pub fn new() -> Self {
40 Self {}
41 }
42 }
43
44 impl Response {
45 /// Creates an empty `Response`.
46 pub fn new() -> Self {
47 Self {}
48 }
49 }
50}