peisear 0.1.0

A minimal, sophisticated, solid, and easy issue tracker.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Miscellaneous root routes.

use axum::response::{IntoResponse, Redirect};

use crate::auth::MaybeAuthUser;

pub async fn index(MaybeAuthUser(user): MaybeAuthUser) -> impl IntoResponse {
    match user {
        Some(_) => Redirect::to("/projects"),
        None => Redirect::to("/login"),
    }
}

pub async fn health() -> &'static str {
    "ok"
}