Skip to main content

mangadex_api/v5/
auth.rs

1//! Authentication endpoint handler.
2//!
3//! <https://api.mangadex.org/swagger.html#/Auth>
4
5pub mod check;
6
7use crate::v5::auth::check::CheckEndpoint;
8use crate::HttpClientRef;
9
10/// Authentication endpoint handler builder.
11#[derive(Debug)]
12pub struct AuthBuilder {
13    http_client: HttpClientRef,
14}
15
16impl AuthBuilder {
17    #[doc(hidden)]
18    pub(crate) fn new(http_client: HttpClientRef) -> Self {
19        Self { http_client }
20    }
21
22    /// Check the current session token and get basic info about the authenticated user.
23    ///
24    /// <https://api.mangadex.org/swagger.html#/Auth/get-auth-check>
25    pub fn check(&self) -> CheckEndpoint {
26        CheckEndpoint::new(self.http_client.clone())
27    }
28}