Skip to main content

haste_server/auth_n/global/routes/
mod.rs

1use crate::services::ServerState;
2use axum::Router;
3use axum_extra::routing::RouterExt;
4use haste_fhir_search::SearchEngine;
5use haste_fhir_terminology::FHIRTerminology;
6use haste_repository::Repository;
7use std::sync::Arc;
8
9mod flow;
10mod invitation;
11mod login;
12mod signup;
13mod tenant_select;
14mod verify;
15
16pub fn create_router<
17    Repo: Repository + Send + Sync,
18    Search: SearchEngine + Send + Sync,
19    Terminology: FHIRTerminology + Send + Sync,
20>(
21    _state: Arc<ServerState<Repo, Search, Terminology>>,
22) -> Router<Arc<ServerState<Repo, Search, Terminology>>> {
23    Router::new()
24        .typed_get(tenant_select::tenant_select_get)
25        .typed_post(tenant_select::tenant_select_post)
26        .typed_get(signup::global_signup_get)
27        .typed_post(signup::global_signup_post)
28        .typed_get(login::global_login_get)
29        .typed_post(login::global_login_post)
30        .typed_get(verify::verify_get)
31        .typed_post(verify::verify_post)
32        .typed_post(verify::resend_post)
33        .typed_get(verify::tenant_get)
34        .typed_post(verify::decide_post)
35        .typed_get(verify::create_get)
36        .typed_post(verify::create_post)
37        .typed_get(invitation::invitation_get)
38        .typed_post(invitation::invitation_post)
39}