pub struct AuthManager;Expand description
Authentication manager for handling login/logout
Implementations§
Source§impl AuthManager
impl AuthManager
Sourcepub async fn login() -> CarpResult<()>
pub async fn login() -> CarpResult<()>
Prompt user for credentials and authenticate
Sourcepub async fn logout() -> CarpResult<()>
pub async fn logout() -> CarpResult<()>
Logout by clearing the stored API token
Sourcepub async fn check_auth() -> CarpResult<bool>
pub async fn check_auth() -> CarpResult<bool>
Check if user is currently authenticated
Sourcepub async fn status() -> CarpResult<()>
pub async fn status() -> CarpResult<()>
Get current authentication status
Sourcepub async fn ensure_authenticated() -> CarpResult<()>
pub async fn ensure_authenticated() -> CarpResult<()>
Ensure user is authenticated, prompt to login if not
Auto Trait Implementations§
impl Freeze for AuthManager
impl RefUnwindSafe for AuthManager
impl Send for AuthManager
impl Sync for AuthManager
impl Unpin for AuthManager
impl UnwindSafe for AuthManager
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