|
@@ -16,10 +16,6 @@ const InputHelpBox = defineAsyncComponent(
|
|
() => import("@/components/InputHelpBox.vue")
|
|
() => import("@/components/InputHelpBox.vue")
|
|
);
|
|
);
|
|
|
|
|
|
-const props = defineProps({
|
|
|
|
- mode: { type: String, enum: ["reset", "set"], default: "reset" }
|
|
|
|
-});
|
|
|
|
-
|
|
|
|
const userAuthStore = useUserAuthStore();
|
|
const userAuthStore = useUserAuthStore();
|
|
const { currentUser } = storeToRefs(userAuthStore);
|
|
const { currentUser } = storeToRefs(userAuthStore);
|
|
|
|
|
|
@@ -89,13 +85,6 @@ const submitEmail = () => {
|
|
|
|
|
|
inputs.value.email.hasBeenSentAlready = false;
|
|
inputs.value.email.hasBeenSentAlready = false;
|
|
|
|
|
|
- if (props.mode === "set") {
|
|
|
|
- return socket.dispatch("users.requestPassword", res => {
|
|
|
|
- new Toast(res.message);
|
|
|
|
- if (res.status === "success") step.value = 2;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return socket.dispatch(
|
|
return socket.dispatch(
|
|
"users.requestPasswordReset",
|
|
"users.requestPasswordReset",
|
|
inputs.value.email.value,
|
|
inputs.value.email.value,
|
|
@@ -113,9 +102,7 @@ const verifyCode = () => {
|
|
if (!code.value) return new Toast("Code cannot be empty");
|
|
if (!code.value) return new Toast("Code cannot be empty");
|
|
|
|
|
|
return socket.dispatch(
|
|
return socket.dispatch(
|
|
- props.mode === "set"
|
|
|
|
- ? "users.verifyPasswordCode"
|
|
|
|
- : "users.verifyPasswordResetCode",
|
|
|
|
|
|
+ "users.verifyPasswordResetCode",
|
|
code.value,
|
|
code.value,
|
|
res => {
|
|
res => {
|
|
new Toast(res.message);
|
|
new Toast(res.message);
|
|
@@ -132,9 +119,7 @@ const changePassword = () => {
|
|
return new Toast("Please enter a valid password.");
|
|
return new Toast("Please enter a valid password.");
|
|
|
|
|
|
return socket.dispatch(
|
|
return socket.dispatch(
|
|
- props.mode === "set"
|
|
|
|
- ? "users.changePasswordWithCode"
|
|
|
|
- : "users.changePasswordWithResetCode",
|
|
|
|
|
|
+ "users.changePasswordWithResetCode",
|
|
code.value,
|
|
code.value,
|
|
inputs.value.password.value,
|
|
inputs.value.password.value,
|
|
res => {
|
|
res => {
|
|
@@ -199,14 +184,12 @@ onMounted(() => {
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <page-metadata
|
|
|
|
- :title="mode === 'reset' ? 'Reset password' : 'Set password'"
|
|
|
|
- />
|
|
|
|
|
|
+ <page-metadata title="Reset password" />
|
|
<main-header />
|
|
<main-header />
|
|
<div class="container">
|
|
<div class="container">
|
|
<div class="content-wrapper">
|
|
<div class="content-wrapper">
|
|
<h1 id="title" class="has-text-centered page-title">
|
|
<h1 id="title" class="has-text-centered page-title">
|
|
- {{ mode === "reset" ? "Reset" : "Set" }} your password
|
|
|
|
|
|
+ Reset your password
|
|
</h1>
|
|
</h1>
|
|
|
|
|
|
<div id="steps">
|
|
<div id="steps">
|
|
@@ -466,7 +449,7 @@ onMounted(() => {
|
|
<i class="material-icons success-icon"
|
|
<i class="material-icons success-icon"
|
|
>check_circle</i
|
|
>check_circle</i
|
|
>
|
|
>
|
|
- <h2>Password successfully {{ mode }}</h2>
|
|
|
|
|
|
+ <h2>Password successfully reset</h2>
|
|
<router-link
|
|
<router-link
|
|
class="button is-dark"
|
|
class="button is-dark"
|
|
to="/settings"
|
|
to="/settings"
|
|
@@ -483,7 +466,7 @@ onMounted(() => {
|
|
>
|
|
>
|
|
<i class="material-icons error-icon">error</i>
|
|
<i class="material-icons error-icon">error</i>
|
|
<h2>
|
|
<h2>
|
|
- Password {{ mode }} failed, please try again
|
|
|
|
|
|
+ Password reset failed, please try again
|
|
later
|
|
later
|
|
</h2>
|
|
</h2>
|
|
<router-link
|
|
<router-link
|