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<()>
Login with API key for authentication
Sourcepub async fn deprecated_login() -> CarpResult<()>
👎Deprecated: Use login instead. Username/password authentication is deprecated.
pub async fn deprecated_login() -> CarpResult<()>
Legacy login method (deprecated)
Sourcepub async fn logout() -> CarpResult<()>
pub async fn logout() -> CarpResult<()>
Logout by clearing the stored API key
Sourcepub async fn check_auth() -> CarpResult<bool>
pub async fn check_auth() -> CarpResult<bool>
Check if user is currently authenticated
Sourcepub async fn check_auth_with_key(api_key: Option<&str>) -> CarpResult<bool>
pub async fn check_auth_with_key(api_key: Option<&str>) -> CarpResult<bool>
Check if user is currently authenticated, considering runtime API key
Sourcepub async fn status() -> CarpResult<()>
pub async fn status() -> CarpResult<()>
Get current authentication status
Sourcepub async fn status_with_key(runtime_api_key: Option<&str>) -> CarpResult<()>
pub async fn status_with_key(runtime_api_key: Option<&str>) -> CarpResult<()>
Get current authentication status, considering runtime API key
Sourcepub async fn ensure_authenticated(api_key: Option<&str>) -> CarpResult<()>
pub async fn ensure_authenticated(api_key: Option<&str>) -> 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