From 357936f9eb070ea28cd9dcf30f5f589cb92f2aa6 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Wed, 5 Feb 2025 18:59:59 +0800 Subject: [PATCH] Only send required data for reset password, magic link and send OTP (#33352) --- apps/studio/data/auth/user-reset-password-mutation.ts | 2 +- apps/studio/data/auth/user-send-magic-link-mutation.ts | 2 +- apps/studio/data/auth/user-send-otp-mutation.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/studio/data/auth/user-reset-password-mutation.ts b/apps/studio/data/auth/user-reset-password-mutation.ts index 4a61d1348c7..aeaef00b5d8 100644 --- a/apps/studio/data/auth/user-reset-password-mutation.ts +++ b/apps/studio/data/auth/user-reset-password-mutation.ts @@ -13,7 +13,7 @@ export type UserResetPasswordVariables = { export async function resetPassword({ projectRef, user }: UserResetPasswordVariables) { const { data, error } = await post('/platform/auth/{ref}/recover', { params: { path: { ref: projectRef } }, - body: user, + body: { email: user.email }, }) if (error) handleError(error) diff --git a/apps/studio/data/auth/user-send-magic-link-mutation.ts b/apps/studio/data/auth/user-send-magic-link-mutation.ts index 6a0d168da4c..22037ab8938 100644 --- a/apps/studio/data/auth/user-send-magic-link-mutation.ts +++ b/apps/studio/data/auth/user-send-magic-link-mutation.ts @@ -13,7 +13,7 @@ export type UserSendMagicLinkVariables = { export async function sendMagicLink({ projectRef, user }: UserSendMagicLinkVariables) { const { data, error } = await post('/platform/auth/{ref}/magiclink', { params: { path: { ref: projectRef } }, - body: user, + body: { email: user.email }, }) if (error) handleError(error) diff --git a/apps/studio/data/auth/user-send-otp-mutation.ts b/apps/studio/data/auth/user-send-otp-mutation.ts index 5a4b4021170..1ba5d3239fe 100644 --- a/apps/studio/data/auth/user-send-otp-mutation.ts +++ b/apps/studio/data/auth/user-send-otp-mutation.ts @@ -13,7 +13,7 @@ export type UserSendOTPVariables = { export async function sendOTP({ projectRef, user }: UserSendOTPVariables) { const { data, error } = await post('/platform/auth/{ref}/otp', { params: { path: { ref: projectRef } }, - body: user, + body: { phone: user.phone }, }) if (error) handleError(error)