feat: add v1 users API routes for backward compatibility
- Add /api/v1/users path routing to users service in gateway - Add v1_router() in auth.rs with resend-otp endpoint - Nest /api/v1/users route in main.rs - Support legacy /api/v1/users/resend-otp endpoint
This commit is contained in:
parent
31d4570356
commit
d08449185e
3 changed files with 10 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ impl Services {
|
||||||
// Auth, users, roles, notifications, runtime-config, config, KB, support
|
// Auth, users, roles, notifications, runtime-config, config, KB, support
|
||||||
if path.starts_with("/api/auth")
|
if path.starts_with("/api/auth")
|
||||||
|| path.starts_with("/api/users")
|
|| path.starts_with("/api/users")
|
||||||
|
|| path.starts_with("/api/v1/users")
|
||||||
|| path.starts_with("/api/me")
|
|| path.starts_with("/api/me")
|
||||||
|| path.starts_with("/api/profile")
|
|| path.starts_with("/api/profile")
|
||||||
|| path.starts_with("/api/onboarding")
|
|| path.starts_with("/api/onboarding")
|
||||||
|
|
|
||||||
|
|
@ -724,3 +724,10 @@ async fn switch_role(
|
||||||
"expires_in": 900
|
"expires_in": 900
|
||||||
}))))
|
}))))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── V1 API Router (for backward compatibility) ─────────────────────────
|
||||||
|
|
||||||
|
pub fn v1_router() -> Router<AppState> {
|
||||||
|
Router::new()
|
||||||
|
.route("/resend-otp", post(resend_otp))
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ async fn main() {
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
// ── Auth ─────────────────────────────────────────────────────────
|
// ── Auth ─────────────────────────────────────────────────────────
|
||||||
.nest("/api/auth", handlers::auth::router())
|
.nest("/api/auth", handlers::auth::router())
|
||||||
|
// ── V1 API (backward compatibility) ───────────────────────────────
|
||||||
|
.nest("/api/v1/users", handlers::auth::v1_router())
|
||||||
// ── Roles & User Self-Service ─────────────────────────────────────
|
// ── Roles & User Self-Service ─────────────────────────────────────
|
||||||
.nest("/api/admin/roles", handlers::roles::router())
|
.nest("/api/admin/roles", handlers::roles::router())
|
||||||
.nest("/api/admin/permissions", handlers::permissions::router())
|
.nest("/api/admin/permissions", handlers::permissions::router())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue