add: create user api

This commit is contained in:
trisua 2025-03-21 22:18:36 -04:00
parent 6dff656583
commit cda879f6df
11 changed files with 187 additions and 25 deletions

View file

@ -12,6 +12,8 @@ pub enum Error {
RegistrationDisabled,
DatabaseError,
IncorrectPassword,
AlreadyAuthenticated,
Unknown,
}
impl ToString for Error {
@ -21,6 +23,7 @@ impl ToString for Error {
Error::UserNotFound => "Unable to find user with given parameters".to_string(),
Error::RegistrationDisabled => "Registration is disabled".to_string(),
Error::IncorrectPassword => "The given password is invalid".to_string(),
Error::AlreadyAuthenticated => "Already authenticated".to_string(),
_ => format!("An unknown error as occurred ({:?})", self),
}
}