@fishawack/lab-velocity 2.0.0-beta.4 → 2.0.0-beta.40
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 +441 -37
- package/_Build/vue/components/basic/Button.vue +1 -1
- package/_Build/vue/components/form/Checkbox.vue +10 -0
- package/_Build/vue/components/form/Select.vue +223 -33
- package/_Build/vue/components/form/Spinner.vue +5 -0
- package/_Build/vue/components/layout/Alert.vue +5 -5
- package/_Build/vue/components/layout/Audit.vue +75 -0
- package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +4 -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 +10 -8
- 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} +32 -16
- package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +68 -43
- 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 +42 -88
- package/_Build/vue/modules/AuthModule/js/store.js +15 -6
- package/_Build/vue/modules/AuthModule/{adminRoutes/PCompanies/Children/partials → routes/PCompanies}/form.vue +51 -19
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +273 -0
- package/_Build/vue/modules/AuthModule/routes/PTeams/resource.js +334 -0
- package/_Build/vue/modules/AuthModule/{adminRoutes/PUsers/Children/partials → routes/PUsers}/form.vue +68 -44
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +322 -0
- package/_Build/vue/modules/AuthModule/routes/account-exists.vue +2 -2
- 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 +4 -4
- package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +9 -8
- package/_Build/vue/modules/AuthModule/routes/force-reset.vue +39 -50
- package/_Build/vue/modules/AuthModule/routes/forgot.vue +4 -4
- package/_Build/vue/modules/AuthModule/routes/login.vue +7 -11
- package/_Build/vue/modules/AuthModule/routes/logincallback.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/loginsso.vue +7 -9
- 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 +8 -7
- package/_Build/vue/modules/AuthModule/routes/success-reset.vue +2 -2
- package/_Build/vue/modules/AuthModule/routes/success-verify.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/verify.vue +11 -14
- package/_Build/vue/modules/resource/Children/create.vue +81 -0
- package/_Build/vue/modules/resource/Children/edit.vue +106 -0
- package/_Build/vue/modules/resource/Children/index.vue +42 -0
- package/_Build/vue/modules/resource/Children/partials/form.vue +61 -0
- package/_Build/vue/modules/resource/Children/show.vue +144 -0
- package/_Build/vue/modules/resource/index.js +545 -0
- package/_Build/vue/modules/resource/parent.vue +63 -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 +53 -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 +10 -1
- package/package.json +5 -3
- 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,322 @@
|
|
|
1
|
+
import VelFormRole from "../../../../components/layout/FormRole.vue";
|
|
2
|
+
import VelButton from "../../../../components/basic/Button.vue";
|
|
3
|
+
import Chip from "../../../../components/layout/Chip.vue";
|
|
4
|
+
import Chips from "../../../../components/layout/Chips.vue";
|
|
5
|
+
import VelRoleLegend from "../../../../components/layout/RoleLegend.vue";
|
|
6
|
+
import component from "./form.vue";
|
|
7
|
+
import companyResource from "../PCompanies/resource.js";
|
|
8
|
+
import { defaultResource, meta } from "../../../resource/index.js";
|
|
9
|
+
|
|
10
|
+
import { ElMessageBox } from "element-plus";
|
|
11
|
+
import { ElNotification } from "element-plus";
|
|
12
|
+
import { h, resolveComponent } from "vue";
|
|
13
|
+
import axios from "axios";
|
|
14
|
+
|
|
15
|
+
function generatePassword(
|
|
16
|
+
length = 20,
|
|
17
|
+
characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@-#$",
|
|
18
|
+
) {
|
|
19
|
+
return (
|
|
20
|
+
Array.from(crypto.getRandomValues(new Uint32Array(length)))
|
|
21
|
+
.map((x) => characters[x % characters.length])
|
|
22
|
+
.join("") + Math.floor(Math.random() * 10)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default [
|
|
27
|
+
"users",
|
|
28
|
+
{
|
|
29
|
+
api: {
|
|
30
|
+
params: {
|
|
31
|
+
index: ({ $route }) => ({
|
|
32
|
+
include: "company",
|
|
33
|
+
"filter[withTrashed]": $route.query.trashed,
|
|
34
|
+
}),
|
|
35
|
+
show: () => ({ include: "company" }),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
searchable: {
|
|
39
|
+
value: "email",
|
|
40
|
+
},
|
|
41
|
+
permissions: {
|
|
42
|
+
create: ({ $store }) => $store.getters.can("write users"),
|
|
43
|
+
edit: ({ $store }) => $store.getters.can("write users"),
|
|
44
|
+
delete: ({ $store }) => $store.getters.can("delete users"),
|
|
45
|
+
},
|
|
46
|
+
form: {
|
|
47
|
+
async submit(props) {
|
|
48
|
+
const { model, form, $router, $store, method, resource } =
|
|
49
|
+
props;
|
|
50
|
+
|
|
51
|
+
const hold = form.data();
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
form.populate(resource.form.preparation(props));
|
|
55
|
+
|
|
56
|
+
if (method === "post") {
|
|
57
|
+
const isSSOCompany = props.$refs?.form?.isSSOCompany;
|
|
58
|
+
|
|
59
|
+
if (!isSSOCompany && form.set_password) {
|
|
60
|
+
const password = generatePassword();
|
|
61
|
+
form.password = password;
|
|
62
|
+
form.password_confirmation = password;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let res = await form.post(`/api/users`);
|
|
66
|
+
|
|
67
|
+
if (
|
|
68
|
+
!isSSOCompany &&
|
|
69
|
+
form.set_password &&
|
|
70
|
+
!form.notify_user
|
|
71
|
+
) {
|
|
72
|
+
ElMessageBox.alert(
|
|
73
|
+
`<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>`,
|
|
74
|
+
"User Created",
|
|
75
|
+
{
|
|
76
|
+
confirmButtonText: "Ok",
|
|
77
|
+
dangerouslyUseHTMLString: true,
|
|
78
|
+
},
|
|
79
|
+
)
|
|
80
|
+
.then(() => {
|
|
81
|
+
$router.replace({
|
|
82
|
+
name: "users.show",
|
|
83
|
+
params: { [resource.id]: res.data.id },
|
|
84
|
+
});
|
|
85
|
+
})
|
|
86
|
+
.catch(() => {});
|
|
87
|
+
} else {
|
|
88
|
+
ElNotification({
|
|
89
|
+
title: "Success",
|
|
90
|
+
message: isSSOCompany
|
|
91
|
+
? "SSO user pre-provisioned successfully"
|
|
92
|
+
: "User created a notified of their new account",
|
|
93
|
+
type: "success",
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
$router.replace({
|
|
97
|
+
name: "users.show",
|
|
98
|
+
params: { [resource.id]: res.data.id },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
let res = await form.patch(`/api/users/${model.id}`);
|
|
103
|
+
|
|
104
|
+
// if changing ourselves, re-fetch user data
|
|
105
|
+
if (res.data.id === $store.state.auth.user.id) {
|
|
106
|
+
await $store.dispatch("getUser");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
$router.replace({
|
|
110
|
+
name: "users.show",
|
|
111
|
+
params: { [resource.id]: res.data.id },
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
} catch (e) {
|
|
115
|
+
console.log(e);
|
|
116
|
+
} finally {
|
|
117
|
+
if (!form.successful || !form.__options.resetOnSuccess) {
|
|
118
|
+
form.populate(hold);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
component,
|
|
123
|
+
fields: ({ model, method }) => ({
|
|
124
|
+
...{
|
|
125
|
+
name: model?.name ?? null,
|
|
126
|
+
email: model?.email ?? null,
|
|
127
|
+
roles: model?.overrides_roles_and_permissions
|
|
128
|
+
? model?.roles.map((val) => ({
|
|
129
|
+
label: val.label,
|
|
130
|
+
value: val.id,
|
|
131
|
+
}))
|
|
132
|
+
: [],
|
|
133
|
+
company_id: model?.company_id ?? null,
|
|
134
|
+
},
|
|
135
|
+
...(method === "post"
|
|
136
|
+
? {
|
|
137
|
+
notify_user: true,
|
|
138
|
+
force_password_change: true,
|
|
139
|
+
set_password: true,
|
|
140
|
+
password: null,
|
|
141
|
+
password_confirmation: null,
|
|
142
|
+
}
|
|
143
|
+
: {}),
|
|
144
|
+
}),
|
|
145
|
+
preparation: (props) => {
|
|
146
|
+
const data = props.form.data();
|
|
147
|
+
data.roles = data.roles.map((d) => d.value);
|
|
148
|
+
return data;
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
table: {
|
|
152
|
+
structure: () => [
|
|
153
|
+
{
|
|
154
|
+
key: "name",
|
|
155
|
+
sortable: true,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "email",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
key: "company",
|
|
162
|
+
sortable: true,
|
|
163
|
+
render: ({ model }) =>
|
|
164
|
+
model.company && model.company?.deleted_at
|
|
165
|
+
? h(
|
|
166
|
+
"span",
|
|
167
|
+
{ class: "vel-basic__error" },
|
|
168
|
+
model.company.name,
|
|
169
|
+
)
|
|
170
|
+
: h(resolveComponent("router-link"), {
|
|
171
|
+
class: "underline",
|
|
172
|
+
to: {
|
|
173
|
+
name: "companies.show",
|
|
174
|
+
params: {
|
|
175
|
+
[meta(...companyResource).id]:
|
|
176
|
+
model.company_id,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
text: model.company.name,
|
|
180
|
+
}),
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
key: "role",
|
|
184
|
+
render: ({ model }) =>
|
|
185
|
+
h(
|
|
186
|
+
!model.overrides_roles_and_permissions ||
|
|
187
|
+
model.roles.length === 1
|
|
188
|
+
? Chip
|
|
189
|
+
: Chips,
|
|
190
|
+
!model.overrides_roles_and_permissions
|
|
191
|
+
? {
|
|
192
|
+
name: "inherited",
|
|
193
|
+
label: "Inherited",
|
|
194
|
+
}
|
|
195
|
+
: model.roles.length === 1
|
|
196
|
+
? {
|
|
197
|
+
name: model.roles[0].name,
|
|
198
|
+
label: model.roles[0].label,
|
|
199
|
+
}
|
|
200
|
+
: { array: model.roles },
|
|
201
|
+
),
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
key: "verified",
|
|
205
|
+
label: "Verified",
|
|
206
|
+
render: ({ model }) =>
|
|
207
|
+
h(
|
|
208
|
+
"span",
|
|
209
|
+
{
|
|
210
|
+
title: model.email_verified_at
|
|
211
|
+
? `Verified: ${new Date(model.email_verified_at).toLocaleString()}`
|
|
212
|
+
: "Not verified",
|
|
213
|
+
style: {
|
|
214
|
+
color: model.email_verified_at
|
|
215
|
+
? "green"
|
|
216
|
+
: "red",
|
|
217
|
+
fontSize: "18px",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
model.email_verified_at ? "✓" : "✗",
|
|
221
|
+
),
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
description: {
|
|
226
|
+
structure: () => [
|
|
227
|
+
{
|
|
228
|
+
key: "email",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
key: "company",
|
|
232
|
+
render: ({ model }) =>
|
|
233
|
+
model.company && model.company?.deleted_at
|
|
234
|
+
? h(
|
|
235
|
+
"span",
|
|
236
|
+
{ class: "vel-basic__error" },
|
|
237
|
+
model.company.name,
|
|
238
|
+
)
|
|
239
|
+
: h(resolveComponent("router-link"), {
|
|
240
|
+
class: "underline",
|
|
241
|
+
to: {
|
|
242
|
+
name: "companies.show",
|
|
243
|
+
params: {
|
|
244
|
+
[meta(...companyResource).id]:
|
|
245
|
+
model.company_id,
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
text: model.company.name,
|
|
249
|
+
}),
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
key: "email_verified_at",
|
|
253
|
+
label: "Email Verified",
|
|
254
|
+
render: ({ model }) =>
|
|
255
|
+
h(
|
|
256
|
+
"span",
|
|
257
|
+
{},
|
|
258
|
+
model.email_verified_at
|
|
259
|
+
? new Date(
|
|
260
|
+
model.email_verified_at,
|
|
261
|
+
).toLocaleString()
|
|
262
|
+
: "Not verified",
|
|
263
|
+
),
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
index: {
|
|
268
|
+
layout: [
|
|
269
|
+
...defaultResource.index.layout,
|
|
270
|
+
() =>
|
|
271
|
+
h(VelRoleLegend, {
|
|
272
|
+
class: "mt-5",
|
|
273
|
+
}),
|
|
274
|
+
],
|
|
275
|
+
},
|
|
276
|
+
show: {
|
|
277
|
+
actions: [
|
|
278
|
+
({ model, $store, $root }) =>
|
|
279
|
+
$store.getters.can("impersonate users") &&
|
|
280
|
+
h(
|
|
281
|
+
VelButton,
|
|
282
|
+
{
|
|
283
|
+
type: "danger",
|
|
284
|
+
async onClick() {
|
|
285
|
+
try {
|
|
286
|
+
const user = (
|
|
287
|
+
await axios.post(
|
|
288
|
+
`/api/users/impersonate`,
|
|
289
|
+
{
|
|
290
|
+
user_id: model.id,
|
|
291
|
+
},
|
|
292
|
+
)
|
|
293
|
+
).data.data;
|
|
294
|
+
|
|
295
|
+
$store.commit("setUser", user);
|
|
296
|
+
|
|
297
|
+
if (!$store.getters.can("view admin")) {
|
|
298
|
+
window.location = `${$root.spaUrl}?authenticated=1`;
|
|
299
|
+
}
|
|
300
|
+
} catch (e) {
|
|
301
|
+
console.log(e);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
"Impersonate",
|
|
306
|
+
),
|
|
307
|
+
...defaultResource.show.actions,
|
|
308
|
+
],
|
|
309
|
+
tabs: [
|
|
310
|
+
...defaultResource.show.tabs,
|
|
311
|
+
({ model }) => ({
|
|
312
|
+
label: "Access control",
|
|
313
|
+
component: h(VelFormRole, {
|
|
314
|
+
overrides: model.overrides_roles_and_permissions,
|
|
315
|
+
form: { roles: model.roles.map((d) => d.id) },
|
|
316
|
+
readonly: true,
|
|
317
|
+
}),
|
|
318
|
+
}),
|
|
319
|
+
],
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
];
|
|
@@ -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"
|
|
@@ -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("../../../components/form/basic.vue").default,
|
|
162
|
-
elButton: require("../../../components/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>
|
|
@@ -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,6 +40,7 @@
|
|
|
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: {
|
|
@@ -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
|
},
|