pub struct AuthResource<'c> { /* private fields */ }Implementations§
Source§impl AuthResource<'_>
impl AuthResource<'_>
Sourcepub async fn login(
&self,
username: &str,
password: &str,
) -> Result<Value, PulseError>
pub async fn login( &self, username: &str, password: &str, ) -> Result<Value, PulseError>
POST /api/auth/login — exchanges username + password for a JWT.
On success, the returned token is cached on the parent client so subsequent calls authenticate automatically.
Sourcepub async fn refresh(&self, refresh_token: &str) -> Result<Value, PulseError>
pub async fn refresh(&self, refresh_token: &str) -> Result<Value, PulseError>
POST /api/auth/refresh — exchanges a refresh token for a fresh JWT.
Sourcepub async fn organizations(&self) -> Result<Vec<Value>, PulseError>
pub async fn organizations(&self) -> Result<Vec<Value>, PulseError>
GET /api/auth/organizations — orgs the current user is a member of.
Sourcepub async fn switch_org(&self, org_id: &str) -> Result<Value, PulseError>
pub async fn switch_org(&self, org_id: &str) -> Result<Value, PulseError>
POST /api/auth/switch-org — switches the active organisation.
The new JWT (with updated orgId claim) is cached on the parent client.
Trait Implementations§
Auto Trait Implementations§
impl<'c> Freeze for AuthResource<'c>
impl<'c> !RefUnwindSafe for AuthResource<'c>
impl<'c> Send for AuthResource<'c>
impl<'c> Sync for AuthResource<'c>
impl<'c> Unpin for AuthResource<'c>
impl<'c> UnsafeUnpin for AuthResource<'c>
impl<'c> !UnwindSafe for AuthResource<'c>
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