what2watch/src/generic_handlers.rs

16 lines
385 B
Rust
Raw Normal View History

2023-05-22 23:57:08 +00:00
use axum::response::{IntoResponse, Redirect};
2023-05-29 00:55:16 +00:00
use crate::AuthContext;
2023-05-22 23:57:08 +00:00
pub async fn handle_slash_redir() -> impl IntoResponse {
Redirect::temporary("/")
}
2023-05-29 00:55:16 +00:00
pub async fn handle_slash(auth: AuthContext) -> impl IntoResponse {
if let Some(user) = auth.current_user {
tracing::debug!("Logged in as: {user}");
} else {
tracing::debug!("Not logged in.")
}
}