pub struct WasmAuthClient { /* private fields */ }Expand description
Auth client for WASM/JavaScript usage.
Implementations§
Source§impl WasmAuthClient
impl WasmAuthClient
Sourcepub async fn sign_up(
&self,
email: &str,
password: &str,
) -> Result<JsValue, JsValue>
pub async fn sign_up( &self, email: &str, password: &str, ) -> Result<JsValue, JsValue>
Sign up with email and password. Returns the auth response as JSON.
Sourcepub async fn sign_in_with_password(
&self,
email: &str,
password: &str,
) -> Result<JsValue, JsValue>
pub async fn sign_in_with_password( &self, email: &str, password: &str, ) -> Result<JsValue, JsValue>
Sign in with email and password. Returns the session as JSON.
Sourcepub async fn sign_in_anonymous(&self) -> Result<JsValue, JsValue>
pub async fn sign_in_anonymous(&self) -> Result<JsValue, JsValue>
Sign in anonymously. Returns the session as JSON.
Sourcepub async fn sign_in_with_otp(&self, email: &str) -> Result<(), JsValue>
pub async fn sign_in_with_otp(&self, email: &str) -> Result<(), JsValue>
Send a magic link / OTP to an email address.
Sourcepub async fn get_session(&self) -> Result<JsValue, JsValue>
pub async fn get_session(&self) -> Result<JsValue, JsValue>
Get the current session as JSON (or null).
Sourcepub async fn refresh_session(&self) -> Result<JsValue, JsValue>
pub async fn refresh_session(&self) -> Result<JsValue, JsValue>
Refresh the current session. Returns new session as JSON.
Sourcepub async fn get_user(&self, access_token: &str) -> Result<JsValue, JsValue>
pub async fn get_user(&self, access_token: &str) -> Result<JsValue, JsValue>
Get the user for a given access token. Returns user as JSON.
Trait Implementations§
Source§impl From<WasmAuthClient> for JsValue
impl From<WasmAuthClient> for JsValue
Source§fn from(value: WasmAuthClient) -> Self
fn from(value: WasmAuthClient) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for WasmAuthClient
impl FromWasmAbi for WasmAuthClient
Source§impl IntoWasmAbi for WasmAuthClient
impl IntoWasmAbi for WasmAuthClient
Source§impl LongRefFromWasmAbi for WasmAuthClient
impl LongRefFromWasmAbi for WasmAuthClient
Source§impl OptionFromWasmAbi for WasmAuthClient
impl OptionFromWasmAbi for WasmAuthClient
Source§impl OptionIntoWasmAbi for WasmAuthClient
impl OptionIntoWasmAbi for WasmAuthClient
Source§impl RefFromWasmAbi for WasmAuthClient
impl RefFromWasmAbi for WasmAuthClient
Source§type Anchor = RcRef<WasmAuthClient>
type Anchor = RcRef<WasmAuthClient>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for WasmAuthClient
impl RefMutFromWasmAbi for WasmAuthClient
Source§impl TryFromJsValue for WasmAuthClient
impl TryFromJsValue for WasmAuthClient
Source§impl VectorFromWasmAbi for WasmAuthClient
impl VectorFromWasmAbi for WasmAuthClient
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[WasmAuthClient]>
Source§impl VectorIntoWasmAbi for WasmAuthClient
impl VectorIntoWasmAbi for WasmAuthClient
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[WasmAuthClient]>) -> Self::Abi
Source§impl WasmDescribeVector for WasmAuthClient
impl WasmDescribeVector for WasmAuthClient
impl SupportsConstructor for WasmAuthClient
impl SupportsInstanceProperty for WasmAuthClient
impl SupportsStaticProperty for WasmAuthClient
Auto Trait Implementations§
impl Freeze for WasmAuthClient
impl !RefUnwindSafe for WasmAuthClient
impl Send for WasmAuthClient
impl Sync for WasmAuthClient
impl Unpin for WasmAuthClient
impl UnsafeUnpin for WasmAuthClient
impl !UnwindSafe for WasmAuthClient
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> 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<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.