All modules now use the main IAM JWT (ACCESS_TOKEN_SECRET) for authentication, removing three separate auth systems (hackathon Supabase, hackathon JWT, QR JWT). Changes: - hackathon: replace HackathonJwtService with decode_access_token() from imphnen-libs - remove entire src/auth/ (Supabase signup/login/GitHub/forgot-reset) - remove common/hackathon_jwt.rs, common/supabase_client.rs - remove Supabase from HackathonConfig (JWT, GitHub OAuth, Supabase anon/service keys) - replace Supabase Storage with MinioService from imphnen-libs - all route jwt params removed; hackathon_router takes MinioService instead - qr: replace QrJwtService with decode_access_token() from imphnen-libs - remove entire src/auth/ (register/login/Google OAuth/refresh) - remove common/qr_jwt.rs, src/config.rs - qr_auth_middleware now lazy-upserts users into QR DB on first access - qr_router(pool) — no config needed - gateway: create MinioService once and pass to hackathon_router; qr_router simplified Users now register/login via /v1/auth/* and use the same JWT for all endpoints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
47 lines
1.5 KiB
Rust
47 lines
1.5 KiB
Rust
pub mod config;
|
|
pub mod common;
|
|
pub mod middleware;
|
|
pub mod admin;
|
|
pub mod certificates;
|
|
pub mod chat;
|
|
pub mod storage;
|
|
pub mod submissions;
|
|
pub mod teams;
|
|
pub mod users;
|
|
pub mod invitations;
|
|
pub mod join_requests;
|
|
pub mod winners;
|
|
|
|
pub use admin::hackathon_admin_routes;
|
|
pub use certificates::hackathon_certificates_routes;
|
|
pub use chat::build_chat_routes;
|
|
pub use storage::hackathon_storage_routes;
|
|
pub use submissions::hackathon_submissions_routes;
|
|
pub use teams::build_team_routes;
|
|
pub use users::hackathon_users_routes;
|
|
pub use invitations::build_invitation_routes;
|
|
pub use join_requests::build_join_request_routes;
|
|
pub use winners::hackathon_winners_routes;
|
|
pub use config::HackathonConfig;
|
|
|
|
use axum::Router;
|
|
use sea_orm::DatabaseConnection;
|
|
use std::sync::Arc;
|
|
use imphnen_libs::MinioService;
|
|
|
|
pub fn hackathon_router(db: DatabaseConnection, _config: Arc<HackathonConfig>, minio: Arc<MinioService>) -> Router {
|
|
let pool = Arc::new(db.get_postgres_connection_pool().clone());
|
|
|
|
Router::new()
|
|
.merge(hackathon_users_routes(pool.clone()))
|
|
.merge(build_team_routes(pool.clone()))
|
|
.merge(build_invitation_routes(pool.clone()))
|
|
.merge(build_join_request_routes(pool.clone()))
|
|
.merge(build_chat_routes(pool.clone()))
|
|
.merge(hackathon_submissions_routes(pool.clone()))
|
|
.merge(hackathon_storage_routes(pool.clone(), minio))
|
|
.merge(hackathon_certificates_routes(pool.clone()))
|
|
.merge(hackathon_winners_routes(pool.clone()))
|
|
.merge(hackathon_admin_routes(pool))
|
|
}
|