@fishawack/lab-velocity 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AuthModule/components/AuthModal.vue +7 -2
- package/AuthModule/js/AuthRoutes.js +0 -3
- package/AuthModule/routes/change-password.vue +25 -2
- package/AuthModule/routes/force-reset.vue +10 -1
- package/components/_basic.scss +30 -0
- package/form/basic.vue +14 -4
- package/modules/_AuthModule.scss +12 -11
- package/modules/_modal.scss +3 -0
- package/package.json +1 -1
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
@close="close"
|
|
13
13
|
/>
|
|
14
14
|
</div>
|
|
15
|
-
<button class="button button--modal" @click="open = false"></button>
|
|
16
15
|
</div>
|
|
17
16
|
|
|
18
17
|
</div>
|
|
@@ -91,7 +90,7 @@ export default {
|
|
|
91
90
|
async handler(forcePasswordChange) {
|
|
92
91
|
if(forcePasswordChange) {
|
|
93
92
|
this.compName = this.validComponents["force-reset"];
|
|
94
|
-
this.open =
|
|
93
|
+
this.open = true;
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
}
|
|
@@ -100,6 +99,12 @@ export default {
|
|
|
100
99
|
components: {
|
|
101
100
|
VForceReset: require("../routes/force-reset.vue").default,
|
|
102
101
|
VPasswordChange: require("../routes/change-password.vue").default,
|
|
102
|
+
},
|
|
103
|
+
mounted() {
|
|
104
|
+
if(this.$store.state.auth.forcePasswordChange) {
|
|
105
|
+
this.compName = this.validComponents["force-reset"];
|
|
106
|
+
this.open = true;
|
|
107
|
+
}
|
|
103
108
|
}
|
|
104
109
|
};
|
|
105
110
|
</script>
|
|
@@ -130,9 +130,6 @@ export function configureRoutes(router) {
|
|
|
130
130
|
if (to.query.verified) {
|
|
131
131
|
next({ name: `${authBase}.success-verify` });
|
|
132
132
|
} else if (authenticated) {
|
|
133
|
-
if(forcePasswordChange) {
|
|
134
|
-
next(false);
|
|
135
|
-
}
|
|
136
133
|
if (admin && !user?.admin) {
|
|
137
134
|
next({ name: redirect });
|
|
138
135
|
} else if (to.name === "login" || to.name === `${authBase}.login`) {
|
|
@@ -7,9 +7,21 @@
|
|
|
7
7
|
<p class="AM-mt-2 AM-mb-0">
|
|
8
8
|
Please complete the fields below to change your password.
|
|
9
9
|
</p>
|
|
10
|
+
|
|
10
11
|
<el-input
|
|
11
|
-
v-model="form.password"
|
|
12
12
|
class="AM-mt-3"
|
|
13
|
+
label="Current password"
|
|
14
|
+
placeholder="Enter your current password"
|
|
15
|
+
name="current_password"
|
|
16
|
+
type="password"
|
|
17
|
+
required
|
|
18
|
+
v-model="form.current_password"
|
|
19
|
+
:error="form.errors"
|
|
20
|
+
:password="true"
|
|
21
|
+
/>
|
|
22
|
+
<el-input
|
|
23
|
+
v-model="form.password"
|
|
24
|
+
class="AM-mt-2 AM-mb-2"
|
|
13
25
|
label="New Password"
|
|
14
26
|
placeholder="Enter your new password"
|
|
15
27
|
name="password"
|
|
@@ -17,6 +29,7 @@
|
|
|
17
29
|
type="password"
|
|
18
30
|
autocomplete="new-password"
|
|
19
31
|
required
|
|
32
|
+
:password="true"
|
|
20
33
|
/>
|
|
21
34
|
|
|
22
35
|
<VPasswordValidation :password="form.password" @passwordValid="updatePasswordValidity" />
|
|
@@ -66,6 +79,7 @@ export default {
|
|
|
66
79
|
{
|
|
67
80
|
email: this.$store.state.auth.user?.email,
|
|
68
81
|
password: '',
|
|
82
|
+
current_password: ''
|
|
69
83
|
},
|
|
70
84
|
{ resetOnSuccess: false }
|
|
71
85
|
),
|
|
@@ -113,6 +127,7 @@ export default {
|
|
|
113
127
|
this.$root.errors(e);
|
|
114
128
|
} finally {
|
|
115
129
|
this.loading = false;
|
|
130
|
+
this.postLogin();
|
|
116
131
|
}
|
|
117
132
|
},
|
|
118
133
|
|
|
@@ -121,7 +136,15 @@ export default {
|
|
|
121
136
|
},
|
|
122
137
|
handleButton() {
|
|
123
138
|
this.$emit('close');
|
|
124
|
-
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
async postLogin() {
|
|
142
|
+
this.$store.commit("setAuth", true);
|
|
143
|
+
|
|
144
|
+
const { data: user } = await this.$store.dispatch("getUser", {
|
|
145
|
+
errors: this.$root.errors,
|
|
146
|
+
});
|
|
147
|
+
},
|
|
125
148
|
},
|
|
126
149
|
|
|
127
150
|
metaInfo() {
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
|
|
52
52
|
<script>
|
|
53
53
|
import Form from "form-backend-validation";
|
|
54
|
-
import store from "../js/AuthStore";
|
|
55
54
|
|
|
56
55
|
export default {
|
|
57
56
|
data() {
|
|
@@ -60,6 +59,7 @@ export default {
|
|
|
60
59
|
{
|
|
61
60
|
email: this.$store.state.auth.user?.email,
|
|
62
61
|
password: '',
|
|
62
|
+
otp: true,
|
|
63
63
|
},
|
|
64
64
|
{ resetOnSuccess: false }
|
|
65
65
|
),
|
|
@@ -107,8 +107,17 @@ export default {
|
|
|
107
107
|
this.$root.errors(e);
|
|
108
108
|
} finally {
|
|
109
109
|
this.loading = false;
|
|
110
|
+
await this.postLogin();
|
|
110
111
|
}
|
|
111
112
|
},
|
|
113
|
+
|
|
114
|
+
async postLogin() {
|
|
115
|
+
this.$store.commit("setAuth", true);
|
|
116
|
+
|
|
117
|
+
const { data: user } = await this.$store.dispatch("getUser", {
|
|
118
|
+
errors: this.$root.errors,
|
|
119
|
+
});
|
|
120
|
+
},
|
|
112
121
|
|
|
113
122
|
updatePasswordValidity(isValid) {
|
|
114
123
|
this.isPasswordValid = isValid;
|
package/components/_basic.scss
CHANGED
|
@@ -19,4 +19,34 @@
|
|
|
19
19
|
&__error {
|
|
20
20
|
color: $colorAlert;
|
|
21
21
|
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.form__icon-container {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 50%;
|
|
27
|
+
right: 12px;
|
|
28
|
+
transform: translateY(-50%);
|
|
29
|
+
display: flex;
|
|
30
|
+
|
|
31
|
+
.icon {
|
|
32
|
+
display: flex;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.input--password {
|
|
37
|
+
.el-input-group__append {
|
|
38
|
+
border: none;
|
|
39
|
+
box-shadow: none;
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
position: absolute;
|
|
42
|
+
right: 0px;
|
|
43
|
+
top: 0px;
|
|
44
|
+
padding: 0px;
|
|
45
|
+
}
|
|
46
|
+
.icon {
|
|
47
|
+
width: 24px;
|
|
48
|
+
min-width: 24px;
|
|
49
|
+
padding-bottom: 24px;
|
|
50
|
+
fill: #cfd8dd !important
|
|
51
|
+
}
|
|
22
52
|
}
|
package/form/basic.vue
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
<el-input
|
|
8
8
|
v-bind="{ ...$attrs, class: undefined }"
|
|
9
|
-
:class="[`${baseClass}__textbox
|
|
9
|
+
:class="[`${baseClass}__textbox`, type=== 'password' ? 'input--password': '']"
|
|
10
10
|
:name="name"
|
|
11
11
|
:id="name"
|
|
12
12
|
:disabled="disabled"
|
|
13
13
|
:minlength="minlength"
|
|
14
14
|
:maxlength="maxlength"
|
|
15
|
-
:type="type"
|
|
15
|
+
:type="type === 'password' && visibility ? 'text' : type"
|
|
16
16
|
:placeholder="placeholder"
|
|
17
17
|
v-model="content"
|
|
18
18
|
:required="required"
|
|
@@ -24,8 +24,13 @@
|
|
|
24
24
|
<template v-if="prepend" #prepend>
|
|
25
25
|
<slot name="prepend" />
|
|
26
26
|
</template>
|
|
27
|
-
<template v-if="append" #append>
|
|
27
|
+
<template v-if="append || type === 'password'" #append>
|
|
28
28
|
<slot name="append" />
|
|
29
|
+
|
|
30
|
+
<div v-if="type === 'password'" class="form__icon-container">
|
|
31
|
+
<GSvg name="icon-error" class="form__error-icon icon" embed artboard v-if="error && error.first(name)" />
|
|
32
|
+
<GSvg :name="visibility ? 'icon-visibility' : 'icon-visibility-off'" class="form__action-icon icon pointer" embed artboard @click="visibility = !visibility" />
|
|
33
|
+
</div>
|
|
29
34
|
</template>
|
|
30
35
|
</el-input>
|
|
31
36
|
</XInput>
|
|
@@ -67,7 +72,12 @@ export default {
|
|
|
67
72
|
formatter: {
|
|
68
73
|
type: Function,
|
|
69
74
|
default: null,
|
|
70
|
-
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
visibility: false
|
|
80
|
+
}
|
|
71
81
|
},
|
|
72
82
|
|
|
73
83
|
components: {
|
package/modules/_AuthModule.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import "../components/button";
|
|
2
|
+
@import "../components/basic";
|
|
2
3
|
@import "./modal";
|
|
3
4
|
|
|
4
5
|
// AuthModule
|
|
@@ -98,17 +99,17 @@
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
|
-
&__icon-container{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
&__action-icon {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
102
|
+
// &__icon-container{
|
|
103
|
+
// position: absolute;
|
|
104
|
+
// top: 50%;
|
|
105
|
+
// right: $spacing * 1.5;
|
|
106
|
+
// transform: translateY(-50%);
|
|
107
|
+
// display: flex;
|
|
108
|
+
// }
|
|
109
|
+
// &__action-icon {
|
|
110
|
+
// margin-left: $spacing * 0.5;
|
|
111
|
+
// cursor: pointer;
|
|
112
|
+
// }
|
|
112
113
|
}
|
|
113
114
|
.vel-basic__label {
|
|
114
115
|
font-size: 12px;
|
package/modules/_modal.scss
CHANGED