From ebfe18aca21c7d28d8b7769708412c2479f95e23 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Mon, 29 Jun 2026 21:58:10 -0400 Subject: [PATCH] Use more descriptive errors for signup checks --- src/api/auth.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/auth.rs b/src/api/auth.rs index 4f8a006..b18f44a 100644 --- a/src/api/auth.rs +++ b/src/api/auth.rs @@ -17,12 +17,12 @@ use crate::util::error::{AuthError, Contextualize, Error, ErrorType}; #[post("/api/v1/auth/signup", mut auth: Extension, db_pool: Extension, config: Extension)] pub async fn signup(credentials: UserCredentials) -> Result { if !config.auth.open_signup { - return Err(Error::new_here(ErrorType::Auth(AuthError::Unauthorized))); + return Err(Error::message_here("Signup is disabled")); } // Don't allow signup when already logged in if auth.user.is_some() { - return Err(Error::new_here(ErrorType::Auth(AuthError::Unauthorized))); + return Err(Error::message_here("Log out before creating an account")); } let hashed_creds = credentials