@fishawack/lab-velocity 1.11.0 → 2.0.0-beta.1
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 +13 -7
- package/_base.scss +1 -1
- package/_defaults.scss +2 -3
- package/_variables.scss +16 -18
- package/components/_alert.scss +2 -2
- package/components/_basic.scss +5 -4
- package/components/_breadcrumbs.scss +7 -8
- package/components/_button.scss +11 -12
- package/components/_cascader.scss +1 -1
- package/components/_checkbox.scss +27 -26
- package/components/_chip.scss +24 -0
- package/components/_collapse.scss +2 -3
- package/components/_datepicker.scss +7 -6
- package/components/_footer.scss +1 -1
- package/components/_form.scss +6 -4
- package/components/_header.scss +4 -5
- package/components/_icon.scss +4 -3
- package/components/_inputNumber.scss +4 -3
- package/components/_link.scss +7 -7
- package/components/_loader.scss +3 -4
- package/components/_menu.scss +22 -22
- package/components/_pageTitle.scss +3 -3
- package/components/_permissionLegend.scss +18 -0
- package/components/_select.scss +3 -2
- package/components/_sidebar.scss +5 -6
- package/components/_switch.scss +2 -2
- package/components/_table.scss +3 -3
- package/components/_tooltip.scss +2 -2
- package/components/_typography.scss +71 -62
- package/components/_upload.scss +1 -1
- package/components/_wysiwyg.scss +3 -2
- package/components/_wysiwyg2.scss +37 -31
- package/general.scss +1 -2
- package/index.js +38 -30
- package/modules/_AuthModule.scss +32 -29
- package/modules/_AuthVariables.scss +3 -3
- package/modules/_modal.scss +3 -3
- package/package.json +109 -102
- package/vendor.scss +2 -2
- package/AuthModule/components/AuthModal.vue +0 -110
- package/AuthModule/components/VPasswordValidation.vue +0 -66
- package/AuthModule/js/AuthAxios.js +0 -59
- package/AuthModule/js/AuthRoutes.js +0 -186
- package/AuthModule/js/AuthStore.js +0 -99
- package/AuthModule/js/FakeAPI.js +0 -84
- package/AuthModule/routes/account-exists.vue +0 -35
- package/AuthModule/routes/change-password.vue +0 -162
- package/AuthModule/routes/container.vue +0 -38
- package/AuthModule/routes/expired-reset.vue +0 -76
- package/AuthModule/routes/expired-verification.vue +0 -100
- package/AuthModule/routes/force-reset.vue +0 -142
- package/AuthModule/routes/forgot.vue +0 -87
- package/AuthModule/routes/login.vue +0 -138
- package/AuthModule/routes/logincallback.vue +0 -46
- package/AuthModule/routes/loginheadless.vue +0 -16
- package/AuthModule/routes/loginsso.vue +0 -127
- package/AuthModule/routes/logout.vue +0 -21
- package/AuthModule/routes/register.vue +0 -151
- package/AuthModule/routes/reset.vue +0 -123
- package/AuthModule/routes/success-forgot.vue +0 -117
- package/AuthModule/routes/success-reset.vue +0 -35
- package/AuthModule/routes/success-verify.vue +0 -29
- package/AuthModule/routes/verify.vue +0 -110
- package/Icon.vue +0 -33
- package/Svg.vue +0 -40
- package/basic/Button.vue +0 -111
- package/basic/link.vue +0 -63
- package/form/Cascader.vue +0 -85
- package/form/Checkbox.vue +0 -39
- package/form/CheckboxGroup.vue +0 -69
- package/form/DatePicker.vue +0 -100
- package/form/InputNumber.vue +0 -90
- package/form/Select.vue +0 -110
- package/form/Switch.vue +0 -63
- package/form/Upload.vue +0 -103
- package/form/Wysiwyg.vue +0 -127
- package/form/Wysiwyg2.vue +0 -278
- package/form/basic.vue +0 -88
- package/form/color.vue +0 -22
- package/form/file.vue +0 -89
- package/form/input.js +0 -79
- package/form/input.vue +0 -85
- package/layout/Alert.vue +0 -38
- package/layout/Footer.vue +0 -35
- package/layout/Header.vue +0 -15
- package/layout/Loader.vue +0 -39
- package/layout/Tooltip.vue +0 -46
- package/layout/pageTitle.vue +0 -18
- package/layout/sideBar.vue +0 -27
- package/navigation/Breadcrumbs.vue +0 -32
- package/navigation/BreadcrumbsItem.vue +0 -19
- package/navigation/Menu.vue +0 -16
- package/navigation/MenuItem.vue +0 -20
- package/navigation/MenuItemGroup.vue +0 -20
- package/navigation/SubMenu.vue +0 -20
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
export function authRoutes(node, store, nested = 'auth') {
|
|
3
|
-
return [{
|
|
4
|
-
path: '/'+nested,
|
|
5
|
-
name: nested,
|
|
6
|
-
component: require("../routes/container.vue").default,
|
|
7
|
-
redirect: (to) => {
|
|
8
|
-
return { name: `${nested}.login` };
|
|
9
|
-
},
|
|
10
|
-
children: [
|
|
11
|
-
{
|
|
12
|
-
path: "login-creds",
|
|
13
|
-
component: node
|
|
14
|
-
? ""
|
|
15
|
-
: require("../routes/login.vue")
|
|
16
|
-
.default,
|
|
17
|
-
name: `${nested}.logincreds`
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
path: "login",
|
|
21
|
-
component: node
|
|
22
|
-
? ""
|
|
23
|
-
: require("../routes/loginsso.vue")
|
|
24
|
-
.default,
|
|
25
|
-
name: `${nested}.login`
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
path: "force-login",
|
|
29
|
-
component: node
|
|
30
|
-
? ""
|
|
31
|
-
: require("../routes/loginheadless.vue")
|
|
32
|
-
.default,
|
|
33
|
-
name: `${nested}.force-login`
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
path: "callback",
|
|
37
|
-
component: node
|
|
38
|
-
? ""
|
|
39
|
-
: require("../routes/logincallback.vue")
|
|
40
|
-
.default,
|
|
41
|
-
name: `${nested}.callback`
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
path: "forgot",
|
|
45
|
-
component: require("../routes/forgot.vue").default,
|
|
46
|
-
name: `${nested}.forgot`,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
path: "reset",
|
|
50
|
-
component: require("../routes/reset.vue").default,
|
|
51
|
-
name: `${nested}.reset`,
|
|
52
|
-
props: true,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
path: "force-reset",
|
|
56
|
-
component: require("../routes/force-reset.vue").default,
|
|
57
|
-
name: `${nested}.force-reset`,
|
|
58
|
-
props: true,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
path: "register",
|
|
62
|
-
component: require("../routes/register.vue").default,
|
|
63
|
-
name: `${nested}.register`,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
path: "verify",
|
|
67
|
-
component: require("../routes/verify.vue").default,
|
|
68
|
-
name: `${nested}.verify`,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
path: "verified",
|
|
72
|
-
component: require("../routes/success-verify.vue").default,
|
|
73
|
-
name: `${nested}.success-verify`,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
path: "expired-verification",
|
|
77
|
-
component: require("../routes/expired-verification.vue").default,
|
|
78
|
-
name: `${nested}.expired-verification`,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
path: "expired-reset",
|
|
82
|
-
component: require("../routes/expired-reset.vue").default,
|
|
83
|
-
name: `${nested}.expired-reset`,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
path: "success-reset",
|
|
87
|
-
component: require("../routes/success-reset.vue").default,
|
|
88
|
-
name: `${nested}.success-reset`,
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
path: "success-forgot",
|
|
92
|
-
component: require("../routes/success-forgot.vue").default,
|
|
93
|
-
name: `${nested}.success-forgot`,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
path: "account-exists",
|
|
97
|
-
component: require("../routes/account-exists.vue").default,
|
|
98
|
-
name: `${nested}.account-exists`,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
path: "logout",
|
|
102
|
-
component: require("../routes/logout.vue").default,
|
|
103
|
-
name: `${nested}.logout`,
|
|
104
|
-
meta: {
|
|
105
|
-
guest: true,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
props: true,
|
|
110
|
-
nav: {
|
|
111
|
-
visible: true,
|
|
112
|
-
},
|
|
113
|
-
meta: {
|
|
114
|
-
guest: true,
|
|
115
|
-
header: true,
|
|
116
|
-
footer: false,
|
|
117
|
-
fullpageModal: true,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
path: "/admin",
|
|
122
|
-
redirect: () => {
|
|
123
|
-
const { authenticated } = store.state.auth;
|
|
124
|
-
|
|
125
|
-
if (!authenticated) {
|
|
126
|
-
store.commit("setAuth", true);
|
|
127
|
-
window.location = `${process.env.APP_URL}/login`;
|
|
128
|
-
} else {
|
|
129
|
-
window.location = `${process.env.APP_URL}/`;
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
name: "admin",
|
|
133
|
-
meta: {
|
|
134
|
-
guest: true,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
path: '/callback',
|
|
139
|
-
redirect: { name: `${nested}.callback` }
|
|
140
|
-
}]
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export function configureRoutes(router) {
|
|
144
|
-
|
|
145
|
-
router.beforeEach((to, from, next) => {
|
|
146
|
-
const { authenticated, user, authBase, redirect, forcePasswordChange, autoLogin } = store.state.auth;
|
|
147
|
-
|
|
148
|
-
const admin = to.path.includes("/admin");
|
|
149
|
-
|
|
150
|
-
if (to.query.verified) {
|
|
151
|
-
next({ name: `${authBase}.success-verify` });
|
|
152
|
-
} else if (authenticated) {
|
|
153
|
-
if (admin && !user?.admin) {
|
|
154
|
-
next({ name: redirect });
|
|
155
|
-
} else if (to.name === "login" || to.name === `${authBase}.login`) {
|
|
156
|
-
if(autoLogin) {
|
|
157
|
-
next({ name: `${authBase}.force-login` });
|
|
158
|
-
} else {
|
|
159
|
-
next({ name: redirect });
|
|
160
|
-
}
|
|
161
|
-
} else if (
|
|
162
|
-
!user?.email_verified_at &&
|
|
163
|
-
to.matched.some((d) => d.meta.guest) !== true
|
|
164
|
-
) {
|
|
165
|
-
next({ name: `${authBase}.verify` });
|
|
166
|
-
} else {
|
|
167
|
-
next();
|
|
168
|
-
}
|
|
169
|
-
} else {
|
|
170
|
-
if (to.matched.some((d) => d.meta.guest) === true) {
|
|
171
|
-
next();
|
|
172
|
-
} else if (admin) {
|
|
173
|
-
next({ name: "login" });
|
|
174
|
-
} else if (to.path === "/callback") {
|
|
175
|
-
next({ name: `${authBase}.callback` });
|
|
176
|
-
} else {
|
|
177
|
-
if(autoLogin === true) {
|
|
178
|
-
next({ name: `${authBase}.force-login` });
|
|
179
|
-
} else {
|
|
180
|
-
next({ name: `${authBase}.login` });
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
window.router = router;
|
|
186
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
|
|
4
|
-
const store = {
|
|
5
|
-
state() {
|
|
6
|
-
return {
|
|
7
|
-
authBase : process.env.HYDRATE_ROUTE ?? 'auth',
|
|
8
|
-
authenticated : false,
|
|
9
|
-
forcePasswordChange: false,
|
|
10
|
-
intended: null,
|
|
11
|
-
user: null,
|
|
12
|
-
subscriptions: [],
|
|
13
|
-
isSuperAdmin: false,
|
|
14
|
-
redirect: process.env.HYDRATE_REDIRECT ?? 'index',
|
|
15
|
-
postLoginRedirect: process.env.HYDRATE_FRONTENDREDIRECT ?? process.env.HYDRATE_REDIRECT ?? 'index',
|
|
16
|
-
autoLogin: process.env.HYDRATE_ADMIN === 'true' ? true: false,
|
|
17
|
-
platformName: process.env.HYDRATE_PLATFORM ?? 'Expert Partnership',
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
mutations: {
|
|
22
|
-
setAuth(state, value) {
|
|
23
|
-
state.authenticated = value;
|
|
24
|
-
|
|
25
|
-
if (!value) {
|
|
26
|
-
this.commit("setUser", null);
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
setUser(state, value) {
|
|
30
|
-
state.user = value;
|
|
31
|
-
|
|
32
|
-
if(window.dataLayer){
|
|
33
|
-
window.dataLayer.push({ event: "logic", user: value });
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
setIntended(state, value) {
|
|
37
|
-
state.intended = value;
|
|
38
|
-
},
|
|
39
|
-
setForcePasswordChange(state, value) {
|
|
40
|
-
state.forcePasswordChange = value;
|
|
41
|
-
},
|
|
42
|
-
setIsSuperAdmin(state, value) {
|
|
43
|
-
state.isSuperAdmin = value;
|
|
44
|
-
},
|
|
45
|
-
setSubscriptions(state, value) {
|
|
46
|
-
state.subscriptions = value;
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
actions: {
|
|
51
|
-
getUser({ commit }, { errors, query = "" }) {
|
|
52
|
-
return axios
|
|
53
|
-
.get(`/api/users/self${query}`, {
|
|
54
|
-
params: {
|
|
55
|
-
include: "company"
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
.then((res) => {
|
|
59
|
-
commit("setUser", res.data.data);
|
|
60
|
-
|
|
61
|
-
const isSuperAdmin = (data) => {
|
|
62
|
-
const roles = data.roles.map(r => r.name);
|
|
63
|
-
const permissions = data.permissions.map(p => p.name);
|
|
64
|
-
|
|
65
|
-
return roles.includes('administrator') && permissions.includes('write content');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
commit("setAuth",true);
|
|
69
|
-
|
|
70
|
-
commit("setIsSuperAdmin", isSuperAdmin(res.data.data));
|
|
71
|
-
commit("setForcePasswordChange",res.data.data?.force_password_change);
|
|
72
|
-
|
|
73
|
-
return res.data.data;
|
|
74
|
-
})
|
|
75
|
-
.catch(errors);
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
getSubscriptions({ commit }, { errors, query = "" }) {
|
|
79
|
-
return axios
|
|
80
|
-
.get(`/api/users/self/subscriptions${query}`)
|
|
81
|
-
.then((res) => {
|
|
82
|
-
commit("setSubscriptions", res.data.data);
|
|
83
|
-
return res.data;
|
|
84
|
-
})
|
|
85
|
-
.catch(errors);
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
logout({ commit }, { errors }) {
|
|
89
|
-
commit("setAuth", false);
|
|
90
|
-
commit("setUser", null);
|
|
91
|
-
commit("setSubscriptions", []);
|
|
92
|
-
commit("setIsSuperAdmin", false);
|
|
93
|
-
commit("setForcePasswordChange", false);
|
|
94
|
-
|
|
95
|
-
return axios.post("/logout");
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
export default store;
|
package/AuthModule/js/FakeAPI.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
axios.interceptors.request.use(
|
|
5
|
-
request => {
|
|
6
|
-
throw { isLocal: true, data: retrieveResponse(request) };
|
|
7
|
-
},
|
|
8
|
-
error => {
|
|
9
|
-
return Promise.resolve(error);
|
|
10
|
-
}
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
axios.interceptors.response.use(
|
|
14
|
-
response => {
|
|
15
|
-
return response;
|
|
16
|
-
},
|
|
17
|
-
error => {
|
|
18
|
-
return Promise.resolve(error);
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
function retrieveResponse(request) {
|
|
23
|
-
return fakes[request.url][request.method];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const fakes = {
|
|
27
|
-
"/api/users/self": {
|
|
28
|
-
"get" : {
|
|
29
|
-
"data":{
|
|
30
|
-
"id": 2,
|
|
31
|
-
"company_id": 1,
|
|
32
|
-
"created_at": "2025-04-14T15:11:11.000000Z",
|
|
33
|
-
"updated_at": "2025-04-16T16:45:55.000000Z",
|
|
34
|
-
"newsletter": null,
|
|
35
|
-
"admin": 1,
|
|
36
|
-
"name": "Jeremy Viner",
|
|
37
|
-
"email": "jeremy.viner@avalerehealth.com",
|
|
38
|
-
"email_verified_at": "2025-04-16T16:45:55.000000Z",
|
|
39
|
-
"brands": [],
|
|
40
|
-
"company": {
|
|
41
|
-
"id": 1,
|
|
42
|
-
"name": "Company 0",
|
|
43
|
-
"created_at": "2025-04-14T15:08:50.000000Z",
|
|
44
|
-
"updated_at": "2025-04-14T15:08:50.000000Z",
|
|
45
|
-
"domains": [
|
|
46
|
-
"okuneva.com",
|
|
47
|
-
"bogisich.info",
|
|
48
|
-
"avalerehealth.com"
|
|
49
|
-
],
|
|
50
|
-
"brands": [
|
|
51
|
-
1
|
|
52
|
-
],
|
|
53
|
-
"events": [],
|
|
54
|
-
"therapy_areas": [],
|
|
55
|
-
"event_therapy_areas": [],
|
|
56
|
-
"event_therapy_area_media_types": [],
|
|
57
|
-
"users_count": null,
|
|
58
|
-
"sso_client_id": "5ea409fc-8dcf-423e-b7fa-867422859ea4",
|
|
59
|
-
"sso_client_secret": "aSS8Q~ss0r-uh.fPLHUXVXp2kIs5IfwTjzomrb_I",
|
|
60
|
-
"sso_tenant": "4a33c544-865e-44a4-836f-bc51800f6c5e",
|
|
61
|
-
"sso_type": "azure"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"/user/password": {
|
|
67
|
-
"put": {
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"/logged-in": {
|
|
72
|
-
"get":{"logged-in":true},
|
|
73
|
-
},
|
|
74
|
-
"/logout": {
|
|
75
|
-
"post": {
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"/login" : {
|
|
80
|
-
"post": {
|
|
81
|
-
"two_factor": false
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="relative">
|
|
3
|
-
<section id="resetPasswordForm">
|
|
4
|
-
<h1 class="h2">Account already exists</h1>
|
|
5
|
-
|
|
6
|
-
<p class="mt AM-mb-0 color-21">
|
|
7
|
-
<strong class="">Company: {{ $route.query.company }}</strong>
|
|
8
|
-
</p>
|
|
9
|
-
<p class="AM-mt-0.5">
|
|
10
|
-
Your company already has an active account.
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-
<elButton
|
|
14
|
-
tag="router-link"
|
|
15
|
-
:to="{name: `${$store.state.auth.authBase}.login`}"
|
|
16
|
-
type="primary"
|
|
17
|
-
>
|
|
18
|
-
<span v-text="'Sign in'" />
|
|
19
|
-
</elButton>
|
|
20
|
-
</section>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
export default {
|
|
26
|
-
metaInfo() {
|
|
27
|
-
return {
|
|
28
|
-
title: "Account Exists | Error",
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
components: {
|
|
32
|
-
elButton: require('../../basic/Button.vue').default,
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
</script>
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="relative">
|
|
3
|
-
<section id="resetPasswordForm">
|
|
4
|
-
<h1 class="h2 h2--small" v-html="!form.successful ? 'Change password' : 'Success'" />
|
|
5
|
-
<form class="form" @submit.prevent="submit">
|
|
6
|
-
<div v-if="!form.successful">
|
|
7
|
-
<p class="AM-mt-2 AM-mb-0">
|
|
8
|
-
Please complete the fields below to change your password.
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<el-input
|
|
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"
|
|
25
|
-
label="New Password"
|
|
26
|
-
placeholder="Enter your new password"
|
|
27
|
-
name="password"
|
|
28
|
-
:error="form.errors"
|
|
29
|
-
type="password"
|
|
30
|
-
autocomplete="new-password"
|
|
31
|
-
required
|
|
32
|
-
:password="true"
|
|
33
|
-
/>
|
|
34
|
-
|
|
35
|
-
<VPasswordValidation :password="form.password" @passwordValid="updatePasswordValidity" />
|
|
36
|
-
<div class="flex AM-mt-3">
|
|
37
|
-
<elButton
|
|
38
|
-
class=""
|
|
39
|
-
type="primary"
|
|
40
|
-
:disabled="form.processing || !isPasswordValid"
|
|
41
|
-
:loading="form.processing"
|
|
42
|
-
@click="onSubmit"
|
|
43
|
-
>
|
|
44
|
-
<span v-text="'Change password'" />
|
|
45
|
-
</elButton>
|
|
46
|
-
|
|
47
|
-
<elButton
|
|
48
|
-
class=""
|
|
49
|
-
type="secondary"
|
|
50
|
-
@click="handleButton"
|
|
51
|
-
>
|
|
52
|
-
<span v-text="'Cancel'" />
|
|
53
|
-
</elButton>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<div v-else>
|
|
57
|
-
<strong class="">Email: {{ $store.state.auth?.user?.email }}</strong>
|
|
58
|
-
<p v-text="`Your password has been updated.`" />
|
|
59
|
-
<elButton
|
|
60
|
-
class=""
|
|
61
|
-
type="secondary"
|
|
62
|
-
@click="handleButton"
|
|
63
|
-
>
|
|
64
|
-
<span v-text="'Continue'" />
|
|
65
|
-
</elButton>
|
|
66
|
-
</div>
|
|
67
|
-
</form>
|
|
68
|
-
</section>
|
|
69
|
-
</div>
|
|
70
|
-
</template>
|
|
71
|
-
|
|
72
|
-
<script>
|
|
73
|
-
import Form from "form-backend-validation";
|
|
74
|
-
|
|
75
|
-
export default {
|
|
76
|
-
data() {
|
|
77
|
-
return {
|
|
78
|
-
form: new Form(
|
|
79
|
-
{
|
|
80
|
-
email: this.$store.state.auth.user?.email,
|
|
81
|
-
password: '',
|
|
82
|
-
current_password: ''
|
|
83
|
-
},
|
|
84
|
-
{ resetOnSuccess: false }
|
|
85
|
-
),
|
|
86
|
-
isPasswordValid: false,
|
|
87
|
-
};
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
mounted() {
|
|
91
|
-
|
|
92
|
-
this.$store.dispatch("getUser", {
|
|
93
|
-
errors: this.$root.errors,
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
methods: {
|
|
98
|
-
async onSubmit() {
|
|
99
|
-
this.loading = true;
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
await this.form.put('/user/password');
|
|
103
|
-
await this.login();
|
|
104
|
-
} catch (e) {
|
|
105
|
-
this.$root.errors(e);
|
|
106
|
-
} finally {
|
|
107
|
-
this.loading = false;
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
async login() {
|
|
111
|
-
this.loading = true;
|
|
112
|
-
|
|
113
|
-
try {
|
|
114
|
-
const res = await this.form.post("/login");
|
|
115
|
-
|
|
116
|
-
if(res['logged-in']){
|
|
117
|
-
try{
|
|
118
|
-
await this.$store.dispatch("logout", {
|
|
119
|
-
// errors: this.$root.errors,
|
|
120
|
-
});
|
|
121
|
-
} catch(e){}
|
|
122
|
-
|
|
123
|
-
await this.form.post("/login");
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
} catch (e) {
|
|
127
|
-
this.$root.errors(e);
|
|
128
|
-
} finally {
|
|
129
|
-
this.loading = false;
|
|
130
|
-
this.postLogin();
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
updatePasswordValidity(isValid) {
|
|
135
|
-
this.isPasswordValid = isValid;
|
|
136
|
-
},
|
|
137
|
-
handleButton() {
|
|
138
|
-
this.$emit('close');
|
|
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
|
-
},
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
metaInfo() {
|
|
151
|
-
return {
|
|
152
|
-
title: "Reset Password",
|
|
153
|
-
};
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
components: {
|
|
157
|
-
VPasswordValidation: require("./../components/VPasswordValidation.vue").default,
|
|
158
|
-
elInput: require('../../form/basic.vue').default,
|
|
159
|
-
elButton: require('../../basic/Button.vue').default,
|
|
160
|
-
},
|
|
161
|
-
};
|
|
162
|
-
</script>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="AuthModule">
|
|
3
|
-
<section class="AuthModule__Content">
|
|
4
|
-
<div class="AuthModule__logo__container">
|
|
5
|
-
<router-link to="/" class="logo" aria-label="Go to home page">
|
|
6
|
-
<GSvg
|
|
7
|
-
class="AuthModule__logo"
|
|
8
|
-
:name="logoName"
|
|
9
|
-
embed
|
|
10
|
-
asis
|
|
11
|
-
role="presentation"
|
|
12
|
-
tabindex="-1"
|
|
13
|
-
/>
|
|
14
|
-
</router-link>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="AuthModule__form">
|
|
17
|
-
<router-view />
|
|
18
|
-
</div>
|
|
19
|
-
</section>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
export default {
|
|
25
|
-
mounted() {
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
data() {
|
|
29
|
-
return {
|
|
30
|
-
logoName: process.env.HYDRATE_LOGO,
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
components: {
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
</script>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<h1 class="h2 h2--small">Sorry, your password reset has expired</h1>
|
|
3
|
-
|
|
4
|
-
<p class="AM-mt-2 AM-mb-0 AM-color-highlight">
|
|
5
|
-
<strong class="">Email: {{ form?.email }}</strong>
|
|
6
|
-
</p>
|
|
7
|
-
<p class="AM-mt-0.5">
|
|
8
|
-
For security, password reset requests are only <strong>active for 1 hour</strong>. If you still want to reset your password, please request a new password reset-link.</p>
|
|
9
|
-
|
|
10
|
-
<form class="form"
|
|
11
|
-
@submit.prevent="submit"
|
|
12
|
-
>
|
|
13
|
-
<el-input
|
|
14
|
-
class="hidden"
|
|
15
|
-
v-model="form.email"
|
|
16
|
-
label="Email address"
|
|
17
|
-
name="email"
|
|
18
|
-
:error="form.errors"
|
|
19
|
-
type="email"
|
|
20
|
-
placeholder="Email "
|
|
21
|
-
required
|
|
22
|
-
/>
|
|
23
|
-
<elButton
|
|
24
|
-
type="primary"
|
|
25
|
-
:disabled="form.processing"
|
|
26
|
-
:loading="form.processing"
|
|
27
|
-
@click="onSubmit"
|
|
28
|
-
>
|
|
29
|
-
Request new reset-link
|
|
30
|
-
</elButton>
|
|
31
|
-
|
|
32
|
-
<p class="disclaimer AM-mt-3">
|
|
33
|
-
<router-link class="color-1 underline" :to="{ name: `${$store.state.auth.authBase}.login` }">
|
|
34
|
-
Back to Sign in
|
|
35
|
-
</router-link>
|
|
36
|
-
</p>
|
|
37
|
-
</form>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import Form from "form-backend-validation";
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
components: {
|
|
45
|
-
elInput: require('../../form/basic.vue').default,
|
|
46
|
-
elButton: require('../../basic/Button.vue').default,
|
|
47
|
-
},
|
|
48
|
-
data: () => ({
|
|
49
|
-
form: new Form(
|
|
50
|
-
{
|
|
51
|
-
email: "",
|
|
52
|
-
},
|
|
53
|
-
{ resetOnSuccess: false }
|
|
54
|
-
),
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
methods: {
|
|
58
|
-
async onSubmit() {
|
|
59
|
-
try {
|
|
60
|
-
await this.form.post("/forgot-password");
|
|
61
|
-
|
|
62
|
-
this.$router.push({
|
|
63
|
-
name: `${this.$store.state.auth.authBase}.success-forgot`,
|
|
64
|
-
query: { email: this.form.email },
|
|
65
|
-
});
|
|
66
|
-
} catch (e) {
|
|
67
|
-
this.$root.errors(e);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
mounted(){
|
|
73
|
-
this.form.email = this.$route.query.email;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
</script>
|