pub struct ForgeAuth { /* private fields */ }Expand description
Auth handle provided to components via use_forge_auth().
Implementations§
Source§impl ForgeAuth
impl ForgeAuth
pub fn is_authenticated(&self) -> bool
pub fn access_token(&self) -> Option<String>
pub fn refresh_token(&self) -> Option<String>
Sourcepub fn viewer<V: DeserializeOwned>(&self) -> Option<V>
pub fn viewer<V: DeserializeOwned>(&self) -> Option<V>
Read the stored viewer, deserialized into the app’s type.
Sourcepub fn login(&mut self, access_token: String, refresh_token: String)
pub fn login(&mut self, access_token: String, refresh_token: String)
Set tokens after login/register (no viewer).
Sourcepub fn login_with_viewer<V: Serialize>(
&mut self,
access_token: String,
refresh_token: String,
viewer: &V,
)
pub fn login_with_viewer<V: Serialize>( &mut self, access_token: String, refresh_token: String, viewer: &V, )
Set tokens + viewer after login/register.
Sourcepub fn update_tokens(&mut self, access_token: String, refresh_token: String)
pub fn update_tokens(&mut self, access_token: String, refresh_token: String)
Update tokens (e.g., after a refresh). Preserves existing viewer.
Sourcepub fn update_viewer<V: Serialize>(&mut self, viewer: &V)
pub fn update_viewer<V: Serialize>(&mut self, viewer: &V)
Update just the viewer without touching tokens.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ForgeAuth
impl !RefUnwindSafe for ForgeAuth
impl !Send for ForgeAuth
impl !Sync for ForgeAuth
impl Unpin for ForgeAuth
impl UnsafeUnpin for ForgeAuth
impl !UnwindSafe for ForgeAuth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.