pub mod credentials;
pub mod session;
pub mod storage;
pub mod oauth_atproto;
pub mod callback_server;
pub use credentials::Credentials;
pub use session::{Session, SessionManager};
pub use storage::{CredentialStorage, StorageBackend};
pub use oauth_atproto::AtProtoOAuthManager;
pub use callback_server::{CallbackServer, CallbackResult};
use crate::error::AppError;
pub const DEFAULT_SERVICE: &str = "https://bsky.social";
#[derive(Debug, thiserror::Error)]
pub enum AuthError {
#[error("Authentication failed: {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())
}
}