added support for resetting a password while logged in

This commit is contained in:
Edward Tirado Jr 2026-04-20 14:52:30 -05:00
parent 2ba24773d1
commit 199affd2d6
6 changed files with 126 additions and 12 deletions

View file

@ -4,14 +4,14 @@ const props = defineProps<{
email: string
}>();
const {resetPassword} = useAuth();
const {resetPasswordWithToken} = useAuth();
const password = ref("");
const passwordConfirmation = ref("");
const tokenExpired = ref(false);
const handlePasswordReset = () => {
try {
resetPassword(password.value, passwordConfirmation.value, props.token, props.email);
resetPasswordWithToken(password.value, passwordConfirmation.value, props.token, props.email);
} catch (error: unknown) {
if (error instanceof Error && error.message === "TOKEN_EXPIRED")
tokenExpired.value = true;