Something went wrong. Try again.
The smokesignal.events web application forked from smokesignal.events/smokesignal
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071use thiserror::Error;
/// Represents errors that can occur during user login and authentication.////// These errors typically happen during the authentication process when users/// are logging in to the application, including OAuth flows and DID validation.#[derive(Debug, Error)]pub(crate) enum LoginError { #[error("error-smokesignal-login-1 DID document does not contain a handle identifier")] NoHandle,
/// Error when a DID document does not contain a PDS endpoint. /// /// This error occurs during authentication when the user's DID document /// is retrieved but does not contain a required AT Protocol Personal /// Data Server (PDS) endpoint. #[error("error-smokesignal-login-2 DID document does not contain an AT Protocol PDS endpoint")] NoPDS,
/// Error when an OAuth callback is incomplete. /// /// This error occurs when the OAuth authentication flow callback /// returns with incomplete information, preventing successful authentication. #[error("error-smokesignal-login-3 OAuth callback incomplete")] OAuthCallbackIncomplete,
/// Error when there is an OAuth issuer mismatch. /// /// This error occurs when the issuer in the OAuth response does not /// match the expected issuer, which could indicate a security issue. #[error("error-smokesignal-login-4 OAuth issuer mismatch")] OAuthIssuerMismatch,
/// Error when the login input appears to be an incomplete AT-handle. /// /// This error occurs when a user enters what appears to be a partial /// AT-handle (alphanumeric without a domain). The user should append /// ".bsky.social" and resubmit the form. #[error("error-smokesignal-login-5 Please add '.bsky.social' to your handle and try again")] IncompleteHandle,
/// Error when an OAuth request is not found in storage. /// /// This error occurs during the OAuth callback when the system cannot /// find the corresponding OAuth request that was initiated, possibly /// due to expiration or invalid state parameter. #[error("error-smokesignal-login-6 oauth request not found in storage")] OAuthRequestNotFound,
/// Error when HTTP request for AIP OAuth userinfo fails. /// /// This error occurs during AIP OAuth flow when the HTTP request /// to retrieve user information from the AIP server fails. #[error("error-smokesignal-login-7 HTTP request for userinfo failed")] AipUserinfoRequestFailed,
/// Error when parsing AIP OAuth userinfo response fails. /// /// This error occurs during AIP OAuth flow when the JSON response /// from the AIP userinfo endpoint cannot be parsed. #[error("error-smokesignal-login-8 Parsing HTTP response for userinfo failed")] AipUserinfoParsingFailed,
/// Error when AIP OAuth server returns an error response. /// /// This error occurs when the AIP OAuth server returns an error /// in the userinfo response instead of valid user claims. #[error("error-smokesignal-login-9 AIP OAuth server error: {message}")] AipServerError { message: String },}