authflow 1.0.0
authflow: ^1.0.0 copied to clipboard
A flexible, provider-based authentication toolkit for Flutter with stream-based auth state, customizable storage, and composable UI widgets.
1.0.0 May 25, 2025 #
- Fixed
AuthManager.login()to properly respectdefaultProviderIdfromAuthConfig - Implemented standardized exception handling with
AuthExceptionclass - Added typed exception factory constructors for various authentication scenarios
- Updated providers to use consistent error handling
- Improved testing for exception cases
- Enhanced error reporting with contextual information
- Added test mode support to
AuthEventBusfor improved testability - Fixed event handling in tests to avoid cross-test interference
- Add optional expiration duration for anonymous sessions in AnonymousAuthProvider
- Improved documentation and examples for exception handling
- Enhanced
AuthBuilderwith optimized stream handling and token expiration check
0.0.1 May 19, 2025 #
Initial release of the Authflow package with the following features:
Core Components #
AuthToken: Token management with access token, refresh token, and expiration handlingAuthUser: Abstract user model withDefaultAuthUserimplementationAuthStorage: Interface for persisting authentication stateSecureAuthStorage: Implementation using SharedPreferences for secure storageAuthProvider: Abstract interface for authentication providersAuthStatus: Enum representing authentication states (authenticated, unauthenticated, loading)AuthRegistry: Global registry for managing authentication providersAuthManager: Central orchestrator for authentication operationsAuthConfig: Configuration system for the auth managerAuthEventBus: Reactive event system using RxDart's BehaviorSubject for auth state changes
Authentication Providers #
AnonymousAuthProvider: Provider for anonymous authenticationEmailPasswordAuthProvider: Base provider for email/password authenticationMockEmailPasswordAuthProvider: Implementation for testing or demos
Events #
LoginEvent: Dispatched when a user logs inLogoutEvent: Dispatched when a user logs out
Flutter Widgets #
AuthBuilder: Stream-based widget for building UIs based on auth state
Features #
- Multiple authentication provider support
- Reactive streams for auth status, user, and token
- Secure token and user persistence
- Manual session injection capabilities
- Global event system for cross-app auth state management