Skip to main content

tayvo_authifier/
result.rs

1#[derive(Serialize, Debug, PartialEq, Eq)]
2#[cfg_attr(feature = "schemas", derive(JsonSchema))]
3#[serde(tag = "type")]
4pub enum Error {
5    IncorrectData {
6        with: &'static str,
7    },
8    DatabaseError {
9        operation: &'static str,
10        with: &'static str,
11    },
12    InternalError,
13    OperationFailed,
14
15    RenderFail,
16    MissingHeaders,
17    CaptchaFailed,
18    BlockedByShield,
19
20    InvalidSession,
21    UnverifiedAccount,
22    UnknownUser,
23
24    EmailFailed,
25    InvalidToken,
26    MissingInvite,
27    InvalidInvite,
28    InvalidCredentials,
29
30    CompromisedPassword,
31    ShortPassword,
32    Blacklisted,
33    LockedOut,
34
35    TotpAlreadyEnabled,
36    DisallowedMFAMethod,
37}
38
39pub type Result<T, E = Error> = std::result::Result<T, E>;
40pub type Success = Result<()>;