From f7dde3d6ecaae5ef7563e21483c7d689cd14e958 Mon Sep 17 00:00:00 2001 From: edouardparis Date: Tue, 23 Jul 2024 17:52:53 +0200 Subject: [PATCH] Add redirect_to query parameter to otp request url the redirect_to is setup in ordert to give to the supabase html template that user is using the desktop to authenticate. Therefore, It will display the token instead of the confirmation link button. --- gui/src/lianalite/client/auth.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gui/src/lianalite/client/auth.rs b/gui/src/lianalite/client/auth.rs index b99d26d1..85c5767b 100644 --- a/gui/src/lianalite/client/auth.rs +++ b/gui/src/lianalite/client/auth.rs @@ -87,9 +87,18 @@ impl AuthClient { req } + /// the redirect_to is setup so the supabase html template has the information + /// that user is using the desktop to authenticate and will display the token + /// instead of the confirmation link button. pub async fn sign_in_otp(&self) -> Result<(), AuthError> { let response: Response = self - .request(Method::POST, &format!("{}/auth/v1/otp", self.url)) + .request( + Method::POST, + &format!( + "{}/auth/v1/otp?redirect_to=https://desktop.lianalite.com", + self.url + ), + ) .json(&SignInOtp { email: &self.email, create_user: true,