use crate::app::config::Configuration;
use crate::tokens::Service;
use rocket::Build;
use rocket::Rocket;

pub fn init(config: &Configuration) -> super::InfallibleResult<Service> {
    Ok(Some(Service::init(
        &config.token_secret,
        config.token_validity,
    )))
}

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