diff --git a/server/api/auth/reset-password.post.ts b/server/api/auth/reset-password.post.ts index ea38587..ea77ebd 100644 --- a/server/api/auth/reset-password.post.ts +++ b/server/api/auth/reset-password.post.ts @@ -2,11 +2,18 @@ import { ResetPasswordSchema } from '~~/shared/api-types'; export default defineEventHandler(async (event): Promise => { const body = await readZodBody(event, ResetPasswordSchema); - const grpc = useApiGrpc(event); + const apiFetch = useHttpApi(event); - await grpc.resetPassword({ - password: body.password, - passwordConfirm: body.passwordConfirm, - token: body.resetToken + // The GRPC version requires a login token, which the user doesnt have when resetting password, so we're using the HTTP api + await apiFetch('/v1/reset-password', { + method: 'POST', + body: JSON.stringify({ + password: body.password, + password_confirm: body.passwordConfirm, + token: body.resetToken + }), + headers: { + 'Content-type': 'application/json' + } }); }); diff --git a/src/pages/account/forgot-password.vue b/src/pages/account/forgot-password.vue index 3021bc0..4dd0d3b 100644 --- a/src/pages/account/forgot-password.vue +++ b/src/pages/account/forgot-password.vue @@ -1,5 +1,82 @@ + + + + diff --git a/src/pages/account/register.vue b/src/pages/account/register.vue index a625833..eff01a6 100644 --- a/src/pages/account/register.vue +++ b/src/pages/account/register.vue @@ -115,6 +115,13 @@ async function registerSubmission() { required > +
-