pub struct OtpClient { /* private fields */ }Implementations§
Source§impl OtpClient
impl OtpClient
pub fn new(issuer_url: impl Into<String>) -> Self
Sourcepub fn with_application(self, application: impl Into<String>) -> Self
pub fn with_application(self, application: impl Into<String>) -> Self
Use the application’s registered slug for both OTP send and verify.
Sourcepub fn with_channel(self, channel: impl Into<String>) -> Self
pub fn with_channel(self, channel: impl Into<String>) -> Self
Login OTP delivery channel: sms, whatsapp, or email_otp.
pub async fn send_login_otp( &self, phone: &str, client_id: &str, ) -> Result<OtpSendResponse, AuthError>
pub async fn verify_login_otp( &self, phone: &str, otp: &str, client_id: &str, ) -> Result<LoginResponse, AuthError>
pub async fn send_register_otp( &self, phone: &str, full_name: &str, client_id: &str, ) -> Result<OtpSendResponse, AuthError>
pub async fn verify_register_otp( &self, phone: &str, otp: &str, full_name: &str, client_id: &str, ) -> Result<LoginResponse, AuthError>
pub async fn password_login( &self, email: &str, password: &str, ) -> Result<LoginResponse, AuthError>
Auto Trait Implementations§
impl Freeze for OtpClient
impl !RefUnwindSafe for OtpClient
impl Send for OtpClient
impl Sync for OtpClient
impl Unpin for OtpClient
impl UnsafeUnpin for OtpClient
impl !UnwindSafe for OtpClient
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