diff --git a/libs/client-api/src/http.rs b/libs/client-api/src/http.rs index 7d6e1585..50ac6150 100644 --- a/libs/client-api/src/http.rs +++ b/libs/client-api/src/http.rs @@ -215,6 +215,26 @@ impl Client { self.token.read().subscribe() } + /// Sign in with magic link + #[instrument(level = "debug", skip_all, err)] + pub async fn sign_in_with_magic_link( + &self, + email: &str, + redirect_to: Option, + ) -> Result<(), AppResponseError> { + self + .gotrue_client + .magic_link( + &MagicLinkParams { + email: email.to_owned(), + ..Default::default() + }, + redirect_to, + ) + .await?; + Ok(()) + } + /// Attempts to sign in using a URL, extracting refresh_token from the URL. /// It looks like, e.g., `appflowy-flutter://#access_token=...&expires_in=3600&provider_token=...&refresh_token=...&token_type=bearer`. ///