Skip to content

Commit 72986d3

Browse files
committed
reset password repeat new password
1 parent 909355b commit 72986d3

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11-
"axios": "^0.20.0",
1211
"@sentry/browser": "^5.24.2",
1312
"@sentry/integrations": "^5.24.2",
1413
"@sentry/tracing": "^5.24.2",
14+
"axios": "^0.20.0",
1515
"core-js": "^3.6.5",
1616
"tailwindcss": "^1.8.10",
1717
"vee-validate": "^3.3.11",

frontend/src/main.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Vue from 'vue';
22
import { ValidationProvider, ValidationObserver, extend } from 'vee-validate/dist/vee-validate.full.esm';
3+
import * as Sentry from '@sentry/browser';
4+
import { Vue as VueIntegration } from '@sentry/integrations';
5+
import { Integrations } from '@sentry/tracing';
36
import http from './plugins/http';
47
import errorMessenger from './plugins/errorMessenger';
58
import App from './App.vue';
@@ -8,12 +11,8 @@ import store from './store';
811
import validPassword from './validators/validPassword';
912
import './assets/css/tailwind.css';
1013

11-
import * as Sentry from "@sentry/browser";
12-
import { Vue as VueIntegration } from "@sentry/integrations";
13-
import { Integrations } from "@sentry/tracing";
14-
1514
Sentry.init({
16-
dsn: "https://fc31e918801742e2b1e691067496e257@o450203.ingest.sentry.io/5434440",
15+
dsn: 'https://fc31e918801742e2b1e691067496e257@o450203.ingest.sentry.io/5434440',
1716
integrations: [
1817
new VueIntegration({
1918
Vue,

frontend/src/views/auth/ResetPassword.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<input type="password" placeholder="New Password" v-model="formData.password" class="matcha-input mt-0">
1717
<span class="matcha-input-error">{{ passwordErrorHandler(errors[0]) }}</span>
1818
</ValidationProvider>
19+
<ValidationProvider name="Repeat Password" rules="required|confirmed:Password" v-slot="{errors}">
20+
<input type="password" placeholder="Repeat Password" v-model="formData.passwordRepeat" class="matcha-input mt-4">
21+
<span class="matcha-input-error">{{ passwordErrorHandler(errors[0]) }}</span>
22+
</ValidationProvider>
1923
<input type="submit" :disabled="invalid" value="Reset password" v-bind:class="{'auth-sub-container-content-submit-button': true, 'opacity-50': invalid, 'cursor-pointer': !invalid}">
2024
</form>
2125
</ValidationObserver>
@@ -38,6 +42,7 @@ export default {
3842
data: () => ({
3943
formData: {
4044
password: '',
45+
passwordRepeat: '',
4146
},
4247
passwordHasBeenReset: false,
4348
error: {
@@ -47,9 +52,12 @@ export default {
4752
}),
4853
methods: {
4954
passwordErrorHandler(error) {
50-
if (!error || error === 'The Password field is required') {
55+
if (!error || error === 'The Password field is required' || error === 'The Repeat Password field is required') {
5156
return error;
5257
}
58+
if (error === 'The Repeat Password field confirmation does not match') {
59+
return 'Passwords do not match';
60+
}
5361
return 'This password is too easy to guess';
5462
},
5563
async onSubmit() {

0 commit comments

Comments
 (0)