pub mod callback_server;
pub mod credentials;
pub mod login_flow;
pub mod oauth_atproto;
pub mod session;
pub mod storage;
#[cfg(test)]
mod oauth_tests;
pub use callback_server::{CallbackResult, CallbackServer};
pub use credentials::Credentials;
pub use login_flow::{LoginManager, LoginRequest};
pub use oauth_atproto::AtProtoOAuthManager;
pub use session::{Session, SessionManager};
pub use storage::{CredentialStorage, StorageBackend};
use crate::error::AppError;
pub const DEFAULT_SERVICE: &str = "https://bsky.social";
#[derive(Debug, thiserror::Error)]
pub enum AuthError {
#[error("{0}")]
AuthenticationFailed(String),
#[error("No credentials found for account: {0}")]
NoCredentials(String),
#[allow(dead_code)]
#[error("Token expired")]
TokenExpired,
#[allow(dead_code)]
#[error("Failed to refresh token: {0}")]
RefreshFailed(String),
#[allow(dead_code)]
#[error("Invalid session data: {0}")]
InvalidSession(String),
}
impl From<AuthError> for AppError {
fn from(err: AuthError) -> Self {
AppError::Authentication(err.to_string())
}
}