use crate::response::{CT_TEXT_HTML, CT_TEXT_PLAIN};
use axum::body::Body;
use axum::http::Response;
use axum::response::IntoResponse;
#[derive(Debug)]
pub enum OauthRedirectResponse {
Text(String),
Html(String),
}
impl OauthRedirectResponse {
pub fn text(inner: String) -> Self {
Self::Text(inner)
}
pub fn html(inner: String) -> Self {
Self::Html(inner)
}
}
impl IntoResponse for OauthRedirectResponse {
fn into_response(self) -> Response<Body> {
match self {
Self::Text(inner) => ([CT_TEXT_PLAIN], inner).into_response(),
Self::Html(inner) => ([CT_TEXT_HTML], inner).into_response(),
}
}
}