From 5dd56bbb28323ce53bb53bc15eb27a75ee0a9579 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Wed, 12 Feb 2025 03:20:39 +0300 Subject: [PATCH] auth param --- README.md | 1 + src/config.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1bfc718..061fefd 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ max_messages: 100 # chat messages limit -i, --disable-ip-hiding Disable ip hiding -v, --enable-users-ip-viewing Enable users IP viewing -C, --configure Configure client +-a, --disable-auth Disable authentication -h, --help Print help -V, --version Print version ``` diff --git a/src/config.rs b/src/config.rs index 457a05f..7f6c3a2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -173,9 +173,9 @@ pub struct Args { #[arg(short='C', long)] pub configure: bool, - /// Authentication password + /// Disable authentication #[arg(short='a', long)] - pub auth: bool, + pub disable_auth: bool, } pub struct Context { @@ -209,7 +209,7 @@ impl Context { max_messages: config.max_messages, enable_ip_viewing: args.enable_users_ip_viewing || config.enable_ip_viewing, scroll: Arc::new(AtomicUsize::new(0)), - auth: args.auth + auth: !args.disable_auth } } } \ No newline at end of file