feat: add functions to send password reset email and actual password reset in api composable
This commit is contained in:
parent
491e736422
commit
42ed743054
1 changed files with 11 additions and 1 deletions
|
@ -74,6 +74,14 @@ export const useApi = () => {
|
|||
await fetchWithApi("/auth/verify-email", { method: "POST", body: { email } });
|
||||
}
|
||||
|
||||
async function sendPasswordResetEmail(identifier: string): Promise<void> {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue