From 42ed743054acc3bd4cfb37f49ed2293f33b4b48c Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Mon, 14 Jul 2025 22:28:15 +0200 Subject: [PATCH] feat: add functions to send password reset email and actual password reset in api composable --- composables/api.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/composables/api.ts b/composables/api.ts index 0b438a6..9212eb6 100644 --- a/composables/api.ts +++ b/composables/api.ts @@ -74,6 +74,14 @@ export const useApi = () => { await fetchWithApi("/auth/verify-email", { method: "POST", body: { email } }); } + async function sendPasswordResetEmail(identifier: string): Promise { + await fetchWithApi("/auth/reset-password", { method: "GET", query: { identifier } }); + } + + async function resetPassword(password: string, token: string) { + await fetchWithApi("/auth/reset-password", { method: "POST", body: { password, token } }); + } + return { fetchGuilds, fetchGuild, @@ -92,6 +100,8 @@ export const useApi = () => { joinGuild, createChannel, fetchInstanceStats, - sendVerificationEmail + sendVerificationEmail, + sendPasswordResetEmail, + resetPassword } }