rocal-cli 0.2.6

CLI tool for Rocal - Full-Stack WASM framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{
    commands::utils::color::Color,
    rocal_api_client::RocalAPIClient,
    token_manager::{Kind, TokenManager},
};

pub async fn refresh_user_token() {
    if let Ok(refresh_token) = TokenManager::get_token(Kind::RocalRefreshToken) {
        let client = RocalAPIClient::new();
        if let Err(err) = client.refresh_user_login_token(&refresh_token).await {
            println!("{}", Color::Red.text(&err));
        }
    }
}