From 41ec77c8622c644239285afdf80f2acfa7823117 Mon Sep 17 00:00:00 2001 From: eiiko6 Date: Wed, 31 Dec 2025 16:23:08 +0100 Subject: [PATCH] enabled registration --- README.md | 2 +- src/routes/users.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4affd81..7718395 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ - Specify the JWT secret with the `CHATAPP_JWT_SECRET` environment variable. - Specify the server's port with the `CHATAPP_PORT` environment variable. Defaults to `8080`. -- To enable user registration, pass in `CHATAPP_ALLOW_REGISTRATION=true`. +- To disable user registration, pass in `CHATAPP_PROHIBIT_REGISTRATION=true`. diff --git a/src/routes/users.rs b/src/routes/users.rs index eac0f25..149b0dc 100644 --- a/src/routes/users.rs +++ b/src/routes/users.rs @@ -52,7 +52,7 @@ pub fn routes() -> Router { async fn registration_guard(req: Request, next: Next) -> Result { if req.uri().path() == "/register" - && env::var("CHATAPP_ALLOW_REGISTRATION").map_or(true, |v| v.to_lowercase() == "false") + && env::var("CHATAPP_PROHIBIT_REGISTRATION").map_or(false, |v| v.to_lowercase() == "true") { return Err(StatusCode::FORBIDDEN); }