Skip to main content

lnu_elytra/method/
check_login.rs

1use crate::{
2    Client, Error,
3    error::R,
4    utils::{ToHtml, UseInputValue},
5};
6
7impl Client {
8    pub async fn check_login(&self) -> R<String> {
9        self.get(&Client::LOGIN_URL)
10            .send()
11            .await?
12            .doc()
13            .await?
14            .use_val(&Client::S_SESSION_USER_KEY)
15            .map(|s| s.to_owned())
16            .map_err(|_| Error::LoginFailed)
17    }
18}