use crate::app::config::Configuration;
use hagrid_database::StatefulTokens;
use rocket::Build;
use rocket::Rocket;

pub fn init(config: &Configuration) -> super::Result<StatefulTokens> {
    StatefulTokens::new(config.token_dir.as_path()).map(Some)
}

pub fn register(
    rocket: Rocket<Build>,
    _config: &Configuration,
    state: StatefulTokens,
) -> Rocket<Build> {
    rocket.manage(state)
}
