Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Only send required data for reset password, magic link and send OTP (#33352)

Joshen Lim357936f9eb07
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)