Expand description
Built-in auth + viewer state management for forge-dioxus.
Handles token storage, viewer persistence, refresh loops, and 401 recovery. Apps get viewer access for free without writing their own storage layer.
Re-exports§
pub use ForgeAuthProvider_completions::Component::ForgeAuthProvider;
Structs§
- Forge
Auth - Auth handle provided to components via
use_forge_auth(). - Forge
Auth Provider Props - Properties for the
ForgeAuthProvidercomponent.
Enums§
Functions§
- Forge
Auth Provider - Provider component that sets up auth state, ForgeClient with auto token wiring, 401 detection, and periodic refresh.
- use_
auth_ key - Returns a string key that changes on login/logout transitions. Use this to key your router or main content area so SSE subscriptions reconnect with fresh auth state.
- use_
forge_ auth - Read the auth handle from context.
- use_
require_ auth - Guard hook: redirects to
redirect_pathwhen unauthenticated. Returnstrueif authenticated,falseduring redirect. - use_
viewer - Read the stored viewer, deserialized into the app’s viewer type.
Returns
Nonewhen unauthenticated or if the viewer hasn’t been set.