From 92436c8bb9eafcc56219e784f8b374edfb1907a3 Mon Sep 17 00:00:00 2001 From: Daniel Hader Date: Wed, 20 May 2026 22:04:16 -0500 Subject: basic login route with JWT --- src/routes/errors.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/routes/errors.rs') diff --git a/src/routes/errors.rs b/src/routes/errors.rs index 6261d75..78b4e3a 100644 --- a/src/routes/errors.rs +++ b/src/routes/errors.rs @@ -5,6 +5,8 @@ pub enum RouteError { Internal(String), UserCreateEmailExists(String), UserCreateUsernameExists(String), + UnregisteredEmail(String), + AuthorizationFailure(), } impl IntoResponse for RouteError { @@ -18,6 +20,12 @@ impl IntoResponse for RouteError { }, RouteError::UserCreateUsernameExists(username) => { (StatusCode::BAD_REQUEST, format!("user with username \"{}\" already exists", username)) + }, + RouteError::UnregisteredEmail(email) => { + (StatusCode::BAD_REQUEST, format!("email \"{}\" is not registered", email)) + }, + RouteError::AuthorizationFailure() => { + (StatusCode::UNAUTHORIZED, format!("failed to authorize")) } }; -- cgit v1.2.3