|
@@ -0,0 +1,93 @@
|
|
1
|
+<template>
|
|
2
|
+ <main id="main" style="margin-top:-20px; padding-bottom: 500px">
|
|
3
|
+ <div class="container">
|
|
4
|
+ <div>
|
|
5
|
+ <div class="section-header">
|
|
6
|
+ <h2 style="padding-top:40px">New Password</h2>
|
|
7
|
+ </div>
|
|
8
|
+ </div>
|
|
9
|
+ <div class="row mb-4">
|
|
10
|
+ <div class="col-md-12">
|
|
11
|
+ <div v-if="boolSuccess">
|
|
12
|
+ <alert :text="'Password Updated! You will be redirected shortly.'" :type="'SUCCESS'" />
|
|
13
|
+ </div>
|
|
14
|
+ <div v-if="passMissMatch">
|
|
15
|
+ <alert :text="'The passwords do not match'" :type="'ERROR'" />
|
|
16
|
+ </div>
|
|
17
|
+ </div>
|
|
18
|
+ </div>
|
|
19
|
+ <div class="row mb-4">
|
|
20
|
+ <div class="col-md-6">
|
|
21
|
+ <float-label>
|
|
22
|
+ <input
|
|
23
|
+ name="password"
|
|
24
|
+ placeholder="PASSWORD"
|
|
25
|
+ class="form-control uniInput"
|
|
26
|
+ type="password"
|
|
27
|
+ v-model="password"
|
|
28
|
+ @input="passMissMatch = false"
|
|
29
|
+ />
|
|
30
|
+ </float-label>
|
|
31
|
+ </div>
|
|
32
|
+ <div class="col-md-6">
|
|
33
|
+ <float-label>
|
|
34
|
+ <input
|
|
35
|
+ name="confirmPassword"
|
|
36
|
+ placeholder="CONFIRM PASSWORD"
|
|
37
|
+ class="form-control uniInput"
|
|
38
|
+ type="password"
|
|
39
|
+ v-model="confirmPassword"
|
|
40
|
+ @input="passMissMatch = false"
|
|
41
|
+ />
|
|
42
|
+ </float-label>
|
|
43
|
+ </div>
|
|
44
|
+ </div>
|
|
45
|
+ <div class="row">
|
|
46
|
+ <div class="col">
|
|
47
|
+ <button class="btn-solid-blue" @click="updatePassword">Save</button>
|
|
48
|
+ </div>
|
|
49
|
+ </div>
|
|
50
|
+ </div>
|
|
51
|
+ </main>
|
|
52
|
+</template>
|
|
53
|
+
|
|
54
|
+<script>
|
|
55
|
+/* eslint-disable */
|
|
56
|
+import { mapActions } from "vuex";
|
|
57
|
+import Log from "../../assets/Log";
|
|
58
|
+import alert from "../shared/alert";
|
|
59
|
+
|
|
60
|
+export default {
|
|
61
|
+ components: {
|
|
62
|
+ alert
|
|
63
|
+ },
|
|
64
|
+ data() {
|
|
65
|
+ return {
|
|
66
|
+ password: "",
|
|
67
|
+ confirmPassword: "",
|
|
68
|
+ boolSuccess: false,
|
|
69
|
+ passMissMatch: false
|
|
70
|
+ };
|
|
71
|
+ },
|
|
72
|
+ methods: {
|
|
73
|
+ ...mapActions("register", ["updateIndividual"]),
|
|
74
|
+ updatePassword() {
|
|
75
|
+ if (this.password === this.confirmPassword) {
|
|
76
|
+ var userObj = Log.getUser();
|
|
77
|
+ userObj.password = this.password;
|
|
78
|
+ console.log(userObj);
|
|
79
|
+ this.updateIndividual(userObj).then(() => {
|
|
80
|
+ this.boolSuccess = true;
|
|
81
|
+ setTimeout(() => {
|
|
82
|
+ this.$router.push("/user/login");
|
|
83
|
+ }, 2000);
|
|
84
|
+ });
|
|
85
|
+ } else {
|
|
86
|
+ this.passMissMatch = true;
|
|
87
|
+ }
|
|
88
|
+ }
|
|
89
|
+ }
|
|
90
|
+};
|
|
91
|
+</script>
|
|
92
|
+
|
|
93
|
+<style lang="scss" scoped></style>
|