@fishawack/lab-velocity 2.0.0-beta.2 → 2.0.0-beta.20
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/README.md +439 -37
- package/_Build/vue/components/basic/Button.vue +1 -1
- package/_Build/vue/components/form/Select.vue +2 -2
- package/_Build/vue/components/form/Spinner.vue +5 -0
- package/_Build/vue/components/layout/Alert.vue +5 -5
- package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +5 -4
- package/_Build/vue/{modules/AuthModule/components → components/layout}/Chips.vue +2 -2
- package/_Build/vue/components/layout/Footer.vue +11 -10
- package/_Build/vue/{modules/AuthModule/components/VFormFooter.vue → components/layout/FormFooter.vue} +13 -7
- package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +9 -7
- package/_Build/vue/components/layout/Layout.vue +76 -0
- package/_Build/vue/components/layout/Navigation.vue +77 -0
- package/_Build/vue/{modules/AuthModule/components/VPageHeader.vue → components/layout/PageHeader.vue} +7 -2
- package/_Build/vue/components/layout/SideBar.vue +26 -0
- package/_Build/vue/{modules/AuthModule/components/VTable.vue → components/layout/Table.vue} +19 -17
- package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +32 -22
- package/_Build/vue/components/layout/pageTitle.vue +1 -1
- package/_Build/vue/components/navigation/MenuItem.vue +7 -2
- package/_Build/vue/components/navigation/MenuItemGroup.vue +7 -2
- package/_Build/vue/modules/AuthModule/js/axios.js +19 -0
- package/_Build/vue/modules/AuthModule/js/router.js +21 -89
- package/_Build/vue/modules/AuthModule/js/store.js +15 -6
- package/_Build/vue/modules/AuthModule/{adminRoutes/PCompanies/Children/partials → routes/PCompanies}/form.vue +32 -17
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +168 -0
- package/_Build/vue/modules/AuthModule/{adminRoutes/PUsers/Children/partials → routes/PUsers}/form.vue +30 -18
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +202 -0
- package/_Build/vue/modules/AuthModule/routes/account-exists.vue +3 -3
- package/_Build/vue/modules/AuthModule/routes/change-password.vue +23 -24
- package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
- package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +11 -10
- package/_Build/vue/modules/AuthModule/routes/force-reset.vue +24 -28
- package/_Build/vue/modules/AuthModule/routes/forgot.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/login.vue +9 -13
- package/_Build/vue/modules/AuthModule/routes/logincallback.vue +2 -4
- package/_Build/vue/modules/AuthModule/routes/loginsso.vue +9 -11
- package/_Build/vue/modules/AuthModule/routes/logout.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/register.vue +19 -21
- package/_Build/vue/modules/AuthModule/routes/reset.vue +14 -13
- package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +10 -9
- package/_Build/vue/modules/AuthModule/routes/success-reset.vue +3 -3
- package/_Build/vue/modules/AuthModule/routes/success-verify.vue +2 -4
- package/_Build/vue/modules/AuthModule/routes/verify.vue +13 -16
- package/_Build/vue/modules/resource/Children/create.vue +76 -0
- package/_Build/vue/modules/resource/Children/edit.vue +110 -0
- package/_Build/vue/modules/resource/Children/index.vue +47 -0
- package/_Build/vue/modules/resource/Children/partials/form.vue +57 -0
- package/_Build/vue/modules/resource/Children/show.vue +97 -0
- package/_Build/vue/modules/resource/index.js +280 -0
- package/_Build/vue/modules/resource/parent.vue +41 -0
- package/_base.scss +0 -1
- package/_defaults.scss +2 -13
- package/_variables.scss +9 -4
- package/components/_alert.scss +5 -0
- package/components/_auth.scss +163 -0
- package/components/_basic.scss +55 -0
- package/components/_breadcrumbs.scss +39 -0
- package/components/_button.scss +304 -0
- package/components/_cascader.scss +12 -0
- package/components/_checkbox.scss +41 -0
- package/components/_chip.scss +24 -0
- package/components/_collapse.scss +24 -0
- package/components/_datepicker.scss +52 -0
- package/components/_descriptions.scss +2 -0
- package/components/_footer.scss +47 -0
- package/components/_form.scss +24 -0
- package/components/_header.scss +30 -0
- package/components/_icon.scss +25 -0
- package/components/_inputNumber.scss +22 -0
- package/components/_layout.scss +56 -0
- package/components/_link.scss +44 -0
- package/components/_loader.scss +43 -0
- package/components/_menu.scss +112 -0
- package/components/_modal.scss +24 -0
- package/components/_pageTitle.scss +8 -0
- package/components/_permissionLegend.scss +18 -0
- package/components/_select.scss +29 -0
- package/components/_sidebar.scss +41 -0
- package/components/_switch.scss +14 -0
- package/components/_table.scss +20 -0
- package/components/_tooltip.scss +4 -0
- package/components/_typography.scss +162 -0
- package/components/_upload.scss +15 -0
- package/components/_wysiwyg.scss +7 -0
- package/components/_wysiwyg2.scss +142 -0
- package/index.js +7 -1
- package/package.json +4 -2
- package/vendor.scss +0 -1
- package/_Build/vue/components/layout/sideBar.vue +0 -25
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -251
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +0 -62
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +0 -98
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +0 -90
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +0 -262
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -103
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -120
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +0 -36
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/AuthModal.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/Chip.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VPasswordValidation.vue → components/layout/PasswordValidation.vue} +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VRoleLegend.vue → components/layout/RoleLegend.vue} +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import VelFormRole from "../../../../components/layout/FormRole.vue";
|
|
2
|
+
import Chip from "../../../../components/layout/Chip.vue";
|
|
3
|
+
import Chips from "../../../../components/layout/Chips.vue";
|
|
4
|
+
import VelTableSorter from "../../../../components/layout/TableSorter.vue";
|
|
5
|
+
import VelRoleLegend from "../../../../components/layout/RoleLegend.vue";
|
|
6
|
+
import component from "./form.vue";
|
|
7
|
+
import { defaultResource } from "../../../resource/index.js";
|
|
8
|
+
|
|
9
|
+
import { ElMessageBox } from "element-plus";
|
|
10
|
+
import { ElNotification } from "element-plus";
|
|
11
|
+
import { h, resolveComponent } from "vue";
|
|
12
|
+
|
|
13
|
+
function generatePassword(
|
|
14
|
+
length = 20,
|
|
15
|
+
characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@-#$",
|
|
16
|
+
) {
|
|
17
|
+
return (
|
|
18
|
+
Array.from(crypto.getRandomValues(new Uint32Array(length)))
|
|
19
|
+
.map((x) => characters[x % characters.length])
|
|
20
|
+
.join("") + Math.floor(Math.random() * 10)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default [
|
|
25
|
+
"users",
|
|
26
|
+
{
|
|
27
|
+
defaults: "include=company",
|
|
28
|
+
searchable: {
|
|
29
|
+
value: "email",
|
|
30
|
+
},
|
|
31
|
+
permissions: {
|
|
32
|
+
create: ({ $store }) => $store.getters.can("write users"),
|
|
33
|
+
edit: ({ $store }) => $store.getters.can("write users"),
|
|
34
|
+
delete: ({ $store }) => $store.getters.can("delete companies"),
|
|
35
|
+
},
|
|
36
|
+
form: {
|
|
37
|
+
async submit({ model, form, $router, $store, method }) {
|
|
38
|
+
try {
|
|
39
|
+
if (method === "post") {
|
|
40
|
+
if (form.set_password) {
|
|
41
|
+
const password = generatePassword();
|
|
42
|
+
form.password = password;
|
|
43
|
+
form.password_confirmation = password;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let res = await form.post(`/api/users`);
|
|
47
|
+
|
|
48
|
+
if (form.set_password && !form.notify_user) {
|
|
49
|
+
ElMessageBox.alert(
|
|
50
|
+
`<p>The password below will not be shown again. Ensure you've taken a copy if you plan to send manually. <br><br><strong>Email</strong>: ${form.email}<br> <strong>Password</strong>: ${form.password}</p>`,
|
|
51
|
+
"User Created",
|
|
52
|
+
{
|
|
53
|
+
confirmButtonText: "Ok",
|
|
54
|
+
dangerouslyUseHTMLString: true,
|
|
55
|
+
},
|
|
56
|
+
)
|
|
57
|
+
.then(() => {
|
|
58
|
+
$router.replace({
|
|
59
|
+
name: "users.show",
|
|
60
|
+
params: { id: res.data.id },
|
|
61
|
+
});
|
|
62
|
+
})
|
|
63
|
+
.catch(() => {});
|
|
64
|
+
} else {
|
|
65
|
+
ElNotification({
|
|
66
|
+
title: "Success",
|
|
67
|
+
message:
|
|
68
|
+
"User created a notified of their new account",
|
|
69
|
+
type: "success",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
$router.replace({
|
|
73
|
+
name: "users.show",
|
|
74
|
+
params: { id: res.data.id },
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
let res = await form.patch(`/api/users/${model.id}`);
|
|
79
|
+
|
|
80
|
+
// if changing ourselves, re-fetch user data
|
|
81
|
+
if (res.data.id === $store.state.auth.user.id) {
|
|
82
|
+
await $store.dispatch("getUser");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
$router.replace({
|
|
86
|
+
name: "users.show",
|
|
87
|
+
params: { id: res.data.id },
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.log(e);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
component,
|
|
95
|
+
fields: ({ model, method }) => ({
|
|
96
|
+
...{
|
|
97
|
+
name: model?.name ?? null,
|
|
98
|
+
email: model?.email ?? null,
|
|
99
|
+
roles: model?.overrides_roles_and_permissions
|
|
100
|
+
? model?.roles.map((val) => {
|
|
101
|
+
return val.id;
|
|
102
|
+
})
|
|
103
|
+
: [],
|
|
104
|
+
company_id: model?.company_id ?? null,
|
|
105
|
+
},
|
|
106
|
+
...(method === "post"
|
|
107
|
+
? {
|
|
108
|
+
notify_user: true,
|
|
109
|
+
force_password_change: true,
|
|
110
|
+
set_password: true,
|
|
111
|
+
password: null,
|
|
112
|
+
password_confirmation: null,
|
|
113
|
+
}
|
|
114
|
+
: {}),
|
|
115
|
+
}),
|
|
116
|
+
},
|
|
117
|
+
table: {
|
|
118
|
+
structure: [
|
|
119
|
+
{
|
|
120
|
+
key: "name",
|
|
121
|
+
sortable: true,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: "email",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
key: "company",
|
|
128
|
+
sortable: true,
|
|
129
|
+
render: ({ model }) =>
|
|
130
|
+
h(resolveComponent("router-link"), {
|
|
131
|
+
class: "underline",
|
|
132
|
+
to: {
|
|
133
|
+
name: "companies.show",
|
|
134
|
+
params: { id: model.company_id },
|
|
135
|
+
},
|
|
136
|
+
text: model.company.name,
|
|
137
|
+
}),
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: "role",
|
|
141
|
+
render: ({ model }) =>
|
|
142
|
+
h(
|
|
143
|
+
!model.overrides_roles_and_permissions ||
|
|
144
|
+
model.roles.length === 1
|
|
145
|
+
? Chip
|
|
146
|
+
: Chips,
|
|
147
|
+
!model.overrides_roles_and_permissions
|
|
148
|
+
? {
|
|
149
|
+
name: "inherited",
|
|
150
|
+
label: "Inherited",
|
|
151
|
+
}
|
|
152
|
+
: model.roles.length === 1
|
|
153
|
+
? {
|
|
154
|
+
name: model.roles[0].name,
|
|
155
|
+
label: model.roles[0].label,
|
|
156
|
+
}
|
|
157
|
+
: { array: model.roles },
|
|
158
|
+
),
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
description: {
|
|
163
|
+
structure: [
|
|
164
|
+
{
|
|
165
|
+
key: "email",
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
key: "company",
|
|
169
|
+
render: ({ model }) =>
|
|
170
|
+
h(resolveComponent("router-link"), {
|
|
171
|
+
class: "underline",
|
|
172
|
+
to: {
|
|
173
|
+
name: "companies.show",
|
|
174
|
+
params: { id: model.company_id },
|
|
175
|
+
},
|
|
176
|
+
text: model.company.name,
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
index: {
|
|
182
|
+
layout: [
|
|
183
|
+
...defaultResource.index.layout,
|
|
184
|
+
() =>
|
|
185
|
+
h(VelRoleLegend, {
|
|
186
|
+
class: "mt-5",
|
|
187
|
+
}),
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
show: {
|
|
191
|
+
layout: [
|
|
192
|
+
...defaultResource.show.layout,
|
|
193
|
+
({ model }) =>
|
|
194
|
+
h(VelFormRole, {
|
|
195
|
+
overrides: model.overrides_roles_and_permissions,
|
|
196
|
+
form: { roles: model.roles.map((d) => d.id) },
|
|
197
|
+
readonly: true,
|
|
198
|
+
}),
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
];
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
<section id="resetPasswordForm">
|
|
4
4
|
<h1 class="h2">Account already exists</h1>
|
|
5
5
|
|
|
6
|
-
<p class="mt
|
|
6
|
+
<p class="mt mb-0 color-21">
|
|
7
7
|
<strong class="">Company: {{ $route.query.company }}</strong>
|
|
8
8
|
</p>
|
|
9
|
-
<p class="
|
|
9
|
+
<p class="mt-0.5">Your company already has an active account.</p>
|
|
10
10
|
|
|
11
11
|
<elButton
|
|
12
12
|
tag="router-link"
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
29
|
components: {
|
|
30
|
-
elButton: require("
|
|
30
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
</script>
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<form class="form" @submit.prevent="submit">
|
|
9
9
|
<div v-if="!form.successful">
|
|
10
|
-
<p class="
|
|
10
|
+
<p class="mt-2 mb-0">
|
|
11
11
|
Please complete the fields below to change your
|
|
12
12
|
password.
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<el-input
|
|
16
|
-
class="
|
|
16
|
+
class="mt-3"
|
|
17
17
|
label="Current password"
|
|
18
18
|
placeholder="Enter your current password"
|
|
19
19
|
name="current_password"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
/>
|
|
26
26
|
<el-input
|
|
27
27
|
v-model="form.password"
|
|
28
|
-
class="
|
|
28
|
+
class="mt-2 mb-2"
|
|
29
29
|
label="New Password"
|
|
30
30
|
placeholder="Enter your new password"
|
|
31
31
|
name="password"
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
:password="true"
|
|
37
37
|
/>
|
|
38
38
|
|
|
39
|
-
<
|
|
39
|
+
<VelPasswordValidation
|
|
40
40
|
:password="form.password"
|
|
41
41
|
@passwordValid="updatePasswordValidity"
|
|
42
42
|
/>
|
|
43
|
-
<div class="flex
|
|
43
|
+
<div class="flex mt-3">
|
|
44
44
|
<elButton
|
|
45
45
|
native-type="submit"
|
|
46
46
|
class=""
|
|
@@ -66,7 +66,11 @@
|
|
|
66
66
|
>Email: {{ $store.state.auth?.user?.email }}</strong
|
|
67
67
|
>
|
|
68
68
|
<p v-text="`Your password has been updated.`" />
|
|
69
|
-
<elButton
|
|
69
|
+
<elButton
|
|
70
|
+
tag="router-link"
|
|
71
|
+
type="primary"
|
|
72
|
+
:to="{ name: $store.state.auth.redirect }"
|
|
73
|
+
>
|
|
70
74
|
<span v-text="'Continue'" />
|
|
71
75
|
</elButton>
|
|
72
76
|
</div>
|
|
@@ -79,6 +83,14 @@
|
|
|
79
83
|
import Form from "form-backend-validation";
|
|
80
84
|
|
|
81
85
|
export default {
|
|
86
|
+
components: {
|
|
87
|
+
VelPasswordValidation:
|
|
88
|
+
require("../../../components/layout/PasswordValidation.vue")
|
|
89
|
+
.default,
|
|
90
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
91
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
92
|
+
},
|
|
93
|
+
|
|
82
94
|
data() {
|
|
83
95
|
return {
|
|
84
96
|
form: new Form(
|
|
@@ -94,9 +106,7 @@ export default {
|
|
|
94
106
|
},
|
|
95
107
|
|
|
96
108
|
mounted() {
|
|
97
|
-
this.$store.dispatch("getUser"
|
|
98
|
-
errors: this.$root.errors,
|
|
99
|
-
});
|
|
109
|
+
this.$store.dispatch("getUser");
|
|
100
110
|
},
|
|
101
111
|
|
|
102
112
|
methods: {
|
|
@@ -107,7 +117,7 @@ export default {
|
|
|
107
117
|
await this.form.put("/user/password");
|
|
108
118
|
await this.login();
|
|
109
119
|
} catch (e) {
|
|
110
|
-
|
|
120
|
+
console.log(e);
|
|
111
121
|
} finally {
|
|
112
122
|
this.loading = false;
|
|
113
123
|
}
|
|
@@ -120,15 +130,13 @@ export default {
|
|
|
120
130
|
|
|
121
131
|
if (res["logged-in"]) {
|
|
122
132
|
try {
|
|
123
|
-
await this.$store.dispatch("logout"
|
|
124
|
-
// errors: this.$root.errors,
|
|
125
|
-
});
|
|
133
|
+
await this.$store.dispatch("logout");
|
|
126
134
|
} catch (e) {}
|
|
127
135
|
|
|
128
136
|
await this.form.post("/login");
|
|
129
137
|
}
|
|
130
138
|
} catch (e) {
|
|
131
|
-
|
|
139
|
+
console.log(e);
|
|
132
140
|
} finally {
|
|
133
141
|
this.loading = false;
|
|
134
142
|
this.postLogin();
|
|
@@ -143,9 +151,7 @@ export default {
|
|
|
143
151
|
},
|
|
144
152
|
|
|
145
153
|
async postLogin() {
|
|
146
|
-
const { data: user } = await this.$store.dispatch("getUser"
|
|
147
|
-
errors: this.$root.errors,
|
|
148
|
-
});
|
|
154
|
+
const { data: user } = await this.$store.dispatch("getUser");
|
|
149
155
|
},
|
|
150
156
|
},
|
|
151
157
|
|
|
@@ -154,12 +160,5 @@ export default {
|
|
|
154
160
|
title: "Reset Password",
|
|
155
161
|
};
|
|
156
162
|
},
|
|
157
|
-
|
|
158
|
-
components: {
|
|
159
|
-
VPasswordValidation: require("./../components/VPasswordValidation.vue")
|
|
160
|
-
.default,
|
|
161
|
-
elInput: require("../../form/basic.vue").default,
|
|
162
|
-
elButton: require("../../basic/Button.vue").default,
|
|
163
|
-
},
|
|
164
163
|
};
|
|
165
164
|
</script>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<router-link to="/" class="logo" aria-label="Go to home page">
|
|
6
6
|
<GSvg
|
|
7
7
|
class="AuthModule__logo"
|
|
8
|
-
:name="
|
|
8
|
+
:name="$store.state.auth.logo"
|
|
9
9
|
embed
|
|
10
10
|
asis
|
|
11
11
|
role="presentation"
|
|
@@ -21,14 +21,5 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
|
-
export default {
|
|
25
|
-
mounted() {},
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
logoName: process.env.HYDRATE_LOGO,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
components: {},
|
|
33
|
-
};
|
|
24
|
+
export default {};
|
|
34
25
|
</script>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<h1 class="h2 h2--small">Sorry, your password reset has expired</h1>
|
|
3
3
|
|
|
4
|
-
<p class="
|
|
4
|
+
<p class="mt-2 mb-0 color-highlight">
|
|
5
5
|
<strong class="">Email: {{ form?.email }}</strong>
|
|
6
6
|
</p>
|
|
7
|
-
<p class="
|
|
7
|
+
<p class="mt-0.5">
|
|
8
8
|
For security, password reset requests are only
|
|
9
9
|
<strong>active for 1 hour</strong>. If you still want to reset your
|
|
10
10
|
password, please request a new password reset-link.
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
Request new reset-link
|
|
32
32
|
</elButton>
|
|
33
33
|
|
|
34
|
-
<p class="disclaimer
|
|
34
|
+
<p class="disclaimer mt-3">
|
|
35
35
|
<router-link class="color-1 underline" :to="{ name: 'auth.login' }">
|
|
36
36
|
Back to Sign in
|
|
37
37
|
</router-link>
|
|
@@ -44,8 +44,8 @@ import Form from "form-backend-validation";
|
|
|
44
44
|
|
|
45
45
|
export default {
|
|
46
46
|
components: {
|
|
47
|
-
elInput: require("
|
|
48
|
-
elButton: require("
|
|
47
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
48
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
49
49
|
},
|
|
50
50
|
data: () => ({
|
|
51
51
|
form: new Form(
|
|
@@ -66,7 +66,7 @@ export default {
|
|
|
66
66
|
query: { email: this.form.email },
|
|
67
67
|
});
|
|
68
68
|
} catch (e) {
|
|
69
|
-
|
|
69
|
+
console.log(e);
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
},
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
<h1 class="h2 h2--small">Verification link expired</h1>
|
|
3
3
|
|
|
4
4
|
<form class="form" @submit.prevent="submit">
|
|
5
|
-
<p class="
|
|
5
|
+
<p class="mt-2 mb-0 color-highlight">
|
|
6
6
|
<strong class="">Email: {{ form?.email }}</strong>
|
|
7
7
|
</p>
|
|
8
|
-
<p class="
|
|
8
|
+
<p class="mt-0.5">
|
|
9
9
|
This email verification link has expired. Not to worry, we can email
|
|
10
10
|
you a new one.
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<el-input
|
|
14
|
-
class="
|
|
14
|
+
class="mt-2 mb-2.5 hidden"
|
|
15
15
|
v-model="form.email"
|
|
16
16
|
label="Email address"
|
|
17
17
|
name="email"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</elButton>
|
|
33
33
|
</form>
|
|
34
34
|
|
|
35
|
-
<p class="disclaimer
|
|
35
|
+
<p class="disclaimer mt-3">
|
|
36
36
|
Having trouble singing in?
|
|
37
37
|
<a :href="$store.state.auth.contact" class="underline">Contact us</a>
|
|
38
38
|
</p>
|
|
@@ -40,11 +40,12 @@
|
|
|
40
40
|
|
|
41
41
|
<script>
|
|
42
42
|
import Form from "form-backend-validation";
|
|
43
|
+
import { ElNotification } from "element-plus";
|
|
43
44
|
|
|
44
45
|
export default {
|
|
45
46
|
components: {
|
|
46
|
-
elInput: require("
|
|
47
|
-
elButton: require("
|
|
47
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
48
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
48
49
|
},
|
|
49
50
|
data: () => ({
|
|
50
51
|
form: new Form(
|
|
@@ -66,28 +67,28 @@ export default {
|
|
|
66
67
|
|
|
67
68
|
await this.form.post("/email/verification-notification");
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
ElNotification.success({
|
|
70
71
|
message: "Email has been re-sent",
|
|
71
72
|
duration: 10000,
|
|
72
73
|
class: "el-notification--success el-notification--right-override",
|
|
73
74
|
});
|
|
74
75
|
} catch (e) {
|
|
75
76
|
if (e.response && e.response.status === 429) {
|
|
76
|
-
this.notification =
|
|
77
|
+
this.notification = ElNotification({
|
|
77
78
|
type: "warning",
|
|
78
79
|
message: "Please allow 10 minutes before re-requesting",
|
|
79
80
|
duration: 0,
|
|
80
81
|
class: "el-notification--warning el-notification--right-override",
|
|
81
82
|
});
|
|
82
83
|
} else if (e.response && e.response.status === 422) {
|
|
83
|
-
this.notification =
|
|
84
|
+
this.notification = ElNotification({
|
|
84
85
|
type: "error",
|
|
85
86
|
message: e.response.data.message,
|
|
86
87
|
duration: 0,
|
|
87
88
|
class: "el-notification--error el-notification--right-override",
|
|
88
89
|
});
|
|
89
90
|
} else {
|
|
90
|
-
|
|
91
|
+
console.log(e);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
},
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<form class="form" @submit.prevent="submit">
|
|
9
9
|
<div v-if="!form.successful">
|
|
10
|
-
<p class="
|
|
10
|
+
<p class="mt-2 mb-0 color-highlight">
|
|
11
11
|
<strong class=""
|
|
12
12
|
>Email:
|
|
13
13
|
{{ $store.state?.auth?.user?.email }}</strong
|
|
14
14
|
>
|
|
15
15
|
</p>
|
|
16
|
-
<p class="
|
|
16
|
+
<p class="mt-0.5">
|
|
17
17
|
<strong
|
|
18
18
|
>Hello {{ $store.state?.auth?.user?.name }}</strong
|
|
19
19
|
>, and welcome to {{ $root.appName }}. To maintain
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</p>
|
|
24
24
|
<el-input
|
|
25
25
|
v-model="form.password"
|
|
26
|
-
class="
|
|
26
|
+
class="mt-2"
|
|
27
27
|
label="New Password"
|
|
28
28
|
placeholder="Enter new password"
|
|
29
29
|
name="password"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
required
|
|
34
34
|
/>
|
|
35
35
|
|
|
36
|
-
<
|
|
36
|
+
<VelPasswordValidation
|
|
37
37
|
:password="form.password"
|
|
38
38
|
@passwordValid="updatePasswordValidity"
|
|
39
39
|
/>
|
|
40
40
|
|
|
41
41
|
<elButton
|
|
42
42
|
native-type="submit"
|
|
43
|
-
class="
|
|
43
|
+
class="mt-3"
|
|
44
44
|
type="primary"
|
|
45
45
|
:disabled="form.processing || !isPasswordValid"
|
|
46
46
|
:loading="form.processing"
|
|
@@ -54,8 +54,12 @@
|
|
|
54
54
|
>Email: {{ $store.state.auth?.user?.email }}</strong
|
|
55
55
|
>
|
|
56
56
|
<p v-text="`Your password has been updated.`" />
|
|
57
|
-
<elButton
|
|
58
|
-
|
|
57
|
+
<elButton
|
|
58
|
+
tag="router-link"
|
|
59
|
+
type="primary"
|
|
60
|
+
:to="{ name: $store.state.auth.redirect }"
|
|
61
|
+
>
|
|
62
|
+
<span v-text="'Continue'" />
|
|
59
63
|
</elButton>
|
|
60
64
|
</div>
|
|
61
65
|
</form>
|
|
@@ -67,6 +71,14 @@
|
|
|
67
71
|
import Form from "form-backend-validation";
|
|
68
72
|
|
|
69
73
|
export default {
|
|
74
|
+
components: {
|
|
75
|
+
VelPasswordValidation:
|
|
76
|
+
require("../../../components/layout/PasswordValidation.vue")
|
|
77
|
+
.default,
|
|
78
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
79
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
80
|
+
},
|
|
81
|
+
|
|
70
82
|
data() {
|
|
71
83
|
return {
|
|
72
84
|
form: new Form(
|
|
@@ -81,9 +93,7 @@ export default {
|
|
|
81
93
|
},
|
|
82
94
|
|
|
83
95
|
mounted() {
|
|
84
|
-
this.$store.dispatch("getUser"
|
|
85
|
-
errors: this.$root.errors,
|
|
86
|
-
});
|
|
96
|
+
this.$store.dispatch("getUser");
|
|
87
97
|
},
|
|
88
98
|
|
|
89
99
|
methods: {
|
|
@@ -94,7 +104,7 @@ export default {
|
|
|
94
104
|
await this.form.put("/user/password");
|
|
95
105
|
await this.login();
|
|
96
106
|
} catch (e) {
|
|
97
|
-
|
|
107
|
+
console.log(e);
|
|
98
108
|
} finally {
|
|
99
109
|
this.loading = false;
|
|
100
110
|
}
|
|
@@ -107,15 +117,13 @@ export default {
|
|
|
107
117
|
|
|
108
118
|
if (res["logged-in"]) {
|
|
109
119
|
try {
|
|
110
|
-
await this.$store.dispatch("logout"
|
|
111
|
-
errors: this.$root.errors,
|
|
112
|
-
});
|
|
120
|
+
await this.$store.dispatch("logout");
|
|
113
121
|
} catch (e) {}
|
|
114
122
|
|
|
115
123
|
await this.form.post("/login");
|
|
116
124
|
}
|
|
117
125
|
} catch (e) {
|
|
118
|
-
|
|
126
|
+
console.log(e);
|
|
119
127
|
} finally {
|
|
120
128
|
this.loading = false;
|
|
121
129
|
await this.postLogin();
|
|
@@ -123,17 +131,12 @@ export default {
|
|
|
123
131
|
},
|
|
124
132
|
|
|
125
133
|
async postLogin() {
|
|
126
|
-
const { data: user } = await this.$store.dispatch("getUser"
|
|
127
|
-
errors: this.$root.errors,
|
|
128
|
-
});
|
|
134
|
+
const { data: user } = await this.$store.dispatch("getUser");
|
|
129
135
|
},
|
|
130
136
|
|
|
131
137
|
updatePasswordValidity(isValid) {
|
|
132
138
|
this.isPasswordValid = isValid;
|
|
133
139
|
},
|
|
134
|
-
handleButton() {
|
|
135
|
-
this.$emit("close");
|
|
136
|
-
},
|
|
137
140
|
},
|
|
138
141
|
|
|
139
142
|
metaInfo() {
|
|
@@ -141,12 +144,5 @@ export default {
|
|
|
141
144
|
title: "Reset Password",
|
|
142
145
|
};
|
|
143
146
|
},
|
|
144
|
-
|
|
145
|
-
components: {
|
|
146
|
-
VPasswordValidation: require("./../components/VPasswordValidation.vue")
|
|
147
|
-
.default,
|
|
148
|
-
elInput: require("../../form/basic.vue").default,
|
|
149
|
-
elButton: require("../../basic/Button.vue").default,
|
|
150
|
-
},
|
|
151
147
|
};
|
|
152
148
|
</script>
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
<section id="forgotPasswordForm">
|
|
4
4
|
<h1 class="h2 h2--small">Reset password</h1>
|
|
5
5
|
<form class="form" @submit.prevent="submit">
|
|
6
|
-
<p class="
|
|
6
|
+
<p class="mt-2">
|
|
7
7
|
Enter the email address associated with your account to
|
|
8
8
|
continue.
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<el-input
|
|
12
12
|
v-if="!form.successful"
|
|
13
|
-
class="
|
|
13
|
+
class="mt-3 mb-3"
|
|
14
14
|
v-model="form.email"
|
|
15
15
|
label="Email "
|
|
16
16
|
placeholder="Enter email address"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
Continue
|
|
33
33
|
</elButton>
|
|
34
34
|
|
|
35
|
-
<p class="disclaimer
|
|
35
|
+
<p class="disclaimer mt-3">
|
|
36
36
|
<router-link
|
|
37
37
|
class="color-1 underline"
|
|
38
38
|
:to="{ name: 'auth.login' }"
|
|
@@ -50,8 +50,8 @@ import Form from "form-backend-validation";
|
|
|
50
50
|
|
|
51
51
|
export default {
|
|
52
52
|
components: {
|
|
53
|
-
elInput: require("
|
|
54
|
-
elButton: require("
|
|
53
|
+
elInput: require("../../../components/form/basic.vue").default,
|
|
54
|
+
elButton: require("../../../components/basic/Button.vue").default,
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
data: () => ({
|
|
@@ -73,7 +73,7 @@ export default {
|
|
|
73
73
|
query: { email: this.form.email },
|
|
74
74
|
});
|
|
75
75
|
} catch (e) {
|
|
76
|
-
|
|
76
|
+
console.log(e);
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
},
|