juice_auth 0.2.2 copy "juice_auth: ^0.2.2" to clipboard
juice_auth: ^0.2.2 copied to clipboard

Authentication lifecycle management for Juice applications. Provider-agnostic login, token refresh, session persistence, and reactive auth state.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.2.2 - 2026-06-16 #

Changed #

  • Allow juice_storage 2.0.0 (Hive CE migration). No API change.

0.2.1 - 2026-05-28 #

Added #

  • Tests covering the README's previously-unverified refresh-scheduling claims: the past-window immediate-fire branch of scheduleRefresh, the auto-refresh Timer path (scheduleRefreshTokenExpiryEventRefreshTokenEvent), and singleflight collapse of concurrent RefreshTokenEvents into a single provider call.

Changed #

  • doc/SPEC.md reconciled with the shipping implementation; added an Implementation Notes section documenting intentional divergences (code is the source of truth).

0.2.0 - 2026-04-18 #

Changed #

  • Updated dependencies to juice: ^1.4.0 and juice_storage: ^1.2.0
  • Refreshed README examples to use the current AuthBloc.withConfig(..., storageBloc: ...) setup pattern

0.1.0 - 2026-02-14 #

Added #

  • Initial release of juice_auth
  • AuthBloc — primary bloc managing authentication lifecycle
  • AuthState with AuthStatus enum (unknown, unauthenticated, authenticated, sessionExpired)
  • AuthProvider interface — provider-agnostic contract for auth backends
  • AuthCredentials hierarchy — EmailCredentials, OAuthCredentials, ApiKeyCredentials, BiometricCredentials
  • LoginUseCase — authenticates via provider, persists tokens, emits state
  • LogoutUseCase — atomic cleanup of tokens, storage, and session
  • RefreshTokenUseCase — singleflight token refresh with Completer
  • RestoreSessionUseCase — reads stored tokens on init, refreshes if valid
  • AuthConfig — providers map, refresh buffer, rate limiting, storage prefix
  • AuthError sealed hierarchy — ProviderAuthError, RefreshFailedError, RateLimitedError, etc.
  • Rebuild groupsauth:status, auth:user, auth:session, auth:error
  • AviatorsloginSuccess, logoutComplete, sessionExpired
  • Secure token persistence via juice_storage StorageBloc
  • Login rate limiting — configurable max attempts with cooldown
0
likes
150
points
164
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Authentication lifecycle management for Juice applications. Provider-agnostic login, token refresh, session persistence, and reactive auth state.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#authentication #bloc #state-management #token #session

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter, juice, juice_storage

More

Packages that depend on juice_auth