this repo has no description
at main 23 lines 505 B view raw
1use std::sync::Arc; 2 3use axum::{Extension, response::Response}; 4 5use crate::database::Database; 6 7pub async fn get( 8 Extension(db): Extension<Arc<Database>> 9) -> Response{ 10 let user_count = db.count_users().await.unwrap(); 11 12 let signin_method = if user_count == 0{ 13 "first-time-setup" 14 } else{ 15 "login" 16 }; 17 18 Response::builder() 19 .header("Access-Control-Allow-Origin", "http://127.0.0.1:5173") 20 .header("Access-Control-Allow-Method", "GET") 21 .body(signin_method.into()) 22 .unwrap() 23}