forked from
smokesignal.events/smokesignal
i18n+filtering fork - fluent-templates v2
1use thiserror::Error;
2
3/// Represents errors that can occur during user login and authentication.
4///
5/// These errors typically happen during the authentication process when users
6/// are logging in to the application, including OAuth flows and DID validation.
7#[derive(Debug, Error)]
8pub enum LoginError {
9 /// Error when a DID document does not contain a handle.
10 ///
11 /// This error occurs during authentication when the user's DID document
12 /// is retrieved but does not contain a required handle identifier.
13 #[error("error-login-1 DID document does not contain a handle")]
14 NoHandle,
15
16 /// Error when a DID document does not contain a PDS endpoint.
17 ///
18 /// This error occurs during authentication when the user's DID document
19 /// is retrieved but does not contain a required AT Protocol Personal
20 /// Data Server (PDS) endpoint.
21 #[error("error-login-2 DID document does not contain an AT Protocol PDS endpoint")]
22 NoPDS,
23
24 /// Error when an OAuth callback is incomplete.
25 ///
26 /// This error occurs when the OAuth authentication flow callback
27 /// returns with incomplete information, preventing successful authentication.
28 #[error("error-login-100 OAuth callback incomplete")]
29 OAuthCallbackIncomplete,
30
31 /// Error when there is an OAuth issuer mismatch.
32 ///
33 /// This error occurs when the issuer in the OAuth response does not
34 /// match the expected issuer, which could indicate a security issue.
35 #[error("error-login-101 OAuth issuer mismatch")]
36 OAuthIssuerMismatch,
37}