You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: auth.rs
    path of file: ./repos/krill/src/daemon/http
    
    the code of the file until where you have to start completion: use hyper::Method;

use crate::{
    commons::error::Error,
    daemon::http::{HttpResponse, Request, RoutingResult},
};

#[cfg(feature = "multi-user")]
use {
    crate::daemon::{auth::LoggedInUser, http::server::render_error_redirect},
    urlparse::quote,
};

pub const AUTH_CALLBACK_ENDPOINT: &str = "/auth/callback";
pub const
    
fn build_auth_redirect_location(user: LoggedInUser) -> Result<String, Error> {
    use std::collections::HashMap;

    fn b64_encode_attributes_with_mapped_error(a: &HashMap<String, String>) -> Result<String, Error> {
        Ok(base64::encode(
            serde_json::to_string(a).map_err(|err| Error::custom(err.to_string()))?,
        ))
    }

    let attributes = b64_encode_attributes_with_mapped_error(&user.attributes)?;

    Ok(format!(
        "/ui/login?token={}&id={}&attributes={}",
        &url_encode(user.token)?,
        &url_encode(user.id)?,
        &url_encode(attributes)?
    ))
}