@fishawack/lab-velocity 1.11.1 → 2.0.0-beta.10
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 +177 -49
- package/_Build/vue/components/Icon.vue +33 -0
- package/_Build/vue/components/Svg.vue +45 -0
- package/{basic → _Build/vue/components/basic}/Button.vue +17 -19
- package/{basic → _Build/vue/components/basic}/link.vue +8 -7
- package/{form → _Build/vue/components/form}/Cascader.vue +13 -13
- package/{form → _Build/vue/components/form}/CheckboxGroup.vue +28 -6
- package/{form → _Build/vue/components/form}/DatePicker.vue +23 -7
- package/{form → _Build/vue/components/form}/InputNumber.vue +1 -2
- package/{form → _Build/vue/components/form}/Select.vue +10 -11
- package/_Build/vue/components/form/Spinner.vue +5 -0
- package/{form → _Build/vue/components/form}/Switch.vue +2 -2
- package/{form → _Build/vue/components/form}/Upload.vue +4 -6
- package/{form → _Build/vue/components/form}/Wysiwyg.vue +14 -14
- package/_Build/vue/components/form/Wysiwyg2.vue +577 -0
- package/{form → _Build/vue/components/form}/basic.vue +25 -7
- package/{form → _Build/vue/components/form}/file.vue +1 -1
- package/{form → _Build/vue/components/form}/input.js +2 -2
- package/{form → _Build/vue/components/form}/input.vue +31 -11
- package/{layout → _Build/vue/components/layout}/Alert.vue +10 -10
- package/_Build/vue/components/layout/Footer.vue +50 -0
- package/{layout → _Build/vue/components/layout}/Header.vue +5 -7
- package/_Build/vue/components/layout/Loader.vue +59 -0
- package/{layout → _Build/vue/components/layout}/Tooltip.vue +12 -12
- package/{layout → _Build/vue/components/layout}/pageTitle.vue +4 -4
- package/{layout → _Build/vue/components/layout}/sideBar.vue +4 -6
- package/{navigation → _Build/vue/components/navigation}/Breadcrumbs.vue +15 -10
- package/{navigation → _Build/vue/components/navigation}/BreadcrumbsItem.vue +6 -6
- package/_Build/vue/components/navigation/Menu.vue +14 -0
- package/_Build/vue/components/navigation/MenuItem.vue +20 -0
- package/_Build/vue/components/navigation/MenuItemGroup.vue +20 -0
- package/_Build/vue/components/navigation/SubMenu.vue +20 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +259 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +62 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +98 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +90 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +181 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +267 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +36 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +113 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +101 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +112 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +174 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +123 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +36 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/components/AuthModal.vue +30 -35
- package/_Build/vue/modules/AuthModule/components/Chip.vue +70 -0
- package/_Build/vue/modules/AuthModule/components/Chips.vue +26 -0
- package/_Build/vue/modules/AuthModule/components/FormRole.vue +117 -0
- package/_Build/vue/modules/AuthModule/components/VBreadcrumbs.vue +33 -0
- package/_Build/vue/modules/AuthModule/components/VFormFooter.vue +52 -0
- package/_Build/vue/modules/AuthModule/components/VPageHeader.vue +38 -0
- package/_Build/vue/modules/AuthModule/components/VPasswordValidation.vue +106 -0
- package/_Build/vue/modules/AuthModule/components/VRoleLegend.vue +43 -0
- package/_Build/vue/modules/AuthModule/components/VTable.vue +136 -0
- package/_Build/vue/modules/AuthModule/components/VTableSorter.vue +252 -0
- package/_Build/vue/modules/AuthModule/js/FakeAPI.js +78 -0
- package/_Build/vue/modules/AuthModule/js/axios.js +81 -0
- package/_Build/vue/modules/AuthModule/js/router.js +295 -0
- package/_Build/vue/modules/AuthModule/js/store.js +62 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/account-exists.vue +6 -8
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/change-password.vue +39 -38
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/container.vue +4 -8
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-reset.vue +17 -15
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-verification.vue +21 -20
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/force-reset.vue +45 -40
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/forgot.vue +15 -11
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/login.vue +27 -26
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/logincallback.vue +6 -13
- package/_Build/vue/modules/AuthModule/routes/loginheadless.vue +21 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/loginsso.vue +34 -29
- package/_Build/vue/modules/AuthModule/routes/logout.vue +19 -0
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +25 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/register.vue +52 -37
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/reset.vue +29 -19
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-forgot.vue +22 -19
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-reset.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/success-verify.vue +30 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/verify.vue +26 -26
- package/_base.scss +0 -1
- package/_defaults.scss +3 -15
- package/_variables.scss +24 -21
- package/components/_alert.scss +2 -2
- package/components/_auth.scss +163 -0
- 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/{modules → components}/_modal.scss +3 -3
- 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/package.json +104 -102
- package/vendor.scss +2 -3
- 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/loginheadless.vue +0 -16
- package/AuthModule/routes/logout.vue +0 -21
- package/AuthModule/routes/success-verify.vue +0 -29
- package/Icon.vue +0 -33
- package/Svg.vue +0 -40
- package/components/_input.scss +0 -0
- package/form/Wysiwyg2.vue +0 -278
- package/layout/Footer.vue +0 -35
- package/layout/Loader.vue +0 -39
- package/modules/_AuthModule.scss +0 -209
- package/modules/_AuthVariables.scss +0 -7
- package/navigation/Menu.vue +0 -16
- package/navigation/MenuItem.vue +0 -20
- package/navigation/MenuItemGroup.vue +0 -20
- package/navigation/SubMenu.vue +0 -20
- /package/{form → _Build/vue/components/form}/Checkbox.vue +0 -0
- /package/{form → _Build/vue/components/form}/color.vue +0 -0
package/vendor.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
@import "normalize.css/normalize";
|
|
6
6
|
|
|
7
|
-
#svgSprite{
|
|
7
|
+
#svgSprite {
|
|
8
8
|
position: absolute;
|
|
9
9
|
width: 0;
|
|
10
10
|
height: 0;
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
@import "@fishawack/lab-ui/_typography.scss";
|
|
16
16
|
@import "@fishawack/lab-ui/_grid.scss";
|
|
17
17
|
@import "@fishawack/lab-ui/_button.scss";
|
|
18
|
-
|
|
19
18
|
@import "@fishawack/lab-ui/_utilities.scss";
|
|
20
19
|
|
|
21
20
|
// Element-plus base style
|
|
22
|
-
@import "./_base.scss";
|
|
21
|
+
@import "./_base.scss";
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="">
|
|
3
|
-
<p class="font-700 AM-mb-0.5">Your password must contain:</p>
|
|
4
|
-
<p class="flex m-0">
|
|
5
|
-
<GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-7"
|
|
6
|
-
v-if="passwordLengthValid" />
|
|
7
|
-
<GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-3" v-else />
|
|
8
|
-
At least 8 characters
|
|
9
|
-
</p>
|
|
10
|
-
<p class="flex m-0">
|
|
11
|
-
<GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-7" v-if="hasLetter" />
|
|
12
|
-
<GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-3" v-else />
|
|
13
|
-
At least one letter
|
|
14
|
-
</p>
|
|
15
|
-
<p class="flex AM-mt-0 ml-0 mr-0 AM-mb-3">
|
|
16
|
-
<GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-7" v-if="hasNumberOrSymbol" />
|
|
17
|
-
<GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-3" v-else />
|
|
18
|
-
At least one number or symbol
|
|
19
|
-
</p>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
props: {
|
|
27
|
-
password: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: '',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
computed: {
|
|
33
|
-
passwordLengthValid() {
|
|
34
|
-
return this.password?.length >= 8;
|
|
35
|
-
},
|
|
36
|
-
hasLetter() {
|
|
37
|
-
return this.tests.letter.test(this.password);
|
|
38
|
-
},
|
|
39
|
-
hasNumberOrSymbol() {
|
|
40
|
-
return this.tests.number.test(this.password) || this.tests.symbol.test(this.password);
|
|
41
|
-
},
|
|
42
|
-
passwordValid() {
|
|
43
|
-
return this.passwordLengthValid && this.hasLetter && this.hasNumberOrSymbol;
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
data() {
|
|
47
|
-
return {
|
|
48
|
-
tests: {
|
|
49
|
-
letter: /[a-zA-Z]+/,
|
|
50
|
-
number: /[0-9]+/,
|
|
51
|
-
symbol: /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/,
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
watch: {
|
|
56
|
-
password(newPassword) {
|
|
57
|
-
this.$emit('passwordValid', this.passwordValid);
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
methods: {
|
|
61
|
-
},
|
|
62
|
-
mounted() {
|
|
63
|
-
this.$emit('passwordValid', this.passwordValid);
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
</script>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
function setAxiosDefaults() {
|
|
4
|
-
axios.defaults.baseURL = process.env.APP_URL;
|
|
5
|
-
axios.defaults.withCredentials = true;
|
|
6
|
-
axios.defaults.withXSRFToken = true;
|
|
7
|
-
|
|
8
|
-
// Some libraries will utilize the globally available version of axios so make sure it's our exact axios instance
|
|
9
|
-
window.axios = axios;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Redirect to login page if 401
|
|
13
|
-
axios.interceptors.response.use(null, (error) => {
|
|
14
|
-
if (error.response) {
|
|
15
|
-
if (error.response.status === 401) {
|
|
16
|
-
store.commit("setAuth", false);
|
|
17
|
-
window.router.push({ name: `${store.state.auth.authBase}.login` });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (error.response.status === 404) {
|
|
21
|
-
window.router.push({ name: "index" });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return Promise.reject(error);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Pull all paginated data
|
|
29
|
-
axios.getAll = (url, options = {}) => {
|
|
30
|
-
// eslint-disable-next-line no-async-promise-executor
|
|
31
|
-
return new Promise(async (resolve, reject) => {
|
|
32
|
-
try {
|
|
33
|
-
const arr = { data: { data: [] } };
|
|
34
|
-
let page = 0;
|
|
35
|
-
|
|
36
|
-
// eslint-disable-next-line no-constant-condition
|
|
37
|
-
while (true) {
|
|
38
|
-
// eslint-disable-next-line no-await-in-loop
|
|
39
|
-
const res = await axios.get(
|
|
40
|
-
// eslint-disable-next-line no-plusplus
|
|
41
|
-
`${url}${url.includes("?") ? "&" : "?"}page=${++page}`,
|
|
42
|
-
options
|
|
43
|
-
);
|
|
44
|
-
arr.data.data = arr.data.data.concat(res.data.data);
|
|
45
|
-
if (
|
|
46
|
-
res.data.next_page_url === null ||
|
|
47
|
-
(res.data.links && res.data.links.next === null)
|
|
48
|
-
)
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
resolve(arr);
|
|
53
|
-
} catch (e) {
|
|
54
|
-
reject(e);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
setAxiosDefaults();
|
|
@@ -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,21 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
metaInfo() {
|
|
4
|
-
return {
|
|
5
|
-
title: "Logout",
|
|
6
|
-
};
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
mounted() {
|
|
10
|
-
try {
|
|
11
|
-
this.$store.dispatch("logout", {
|
|
12
|
-
errors: this.$root.errors,
|
|
13
|
-
});
|
|
14
|
-
} catch(e){
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
this.$router.push({ name: `${this.$store.state.auth.authBase}.login` });
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
</script>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<h1 class="h2 h2--small">Verification complete</h1>
|
|
3
|
-
<p class="mb-0"><strong>Welcome to {{ $store.state?.auth?.platformName }}, {{ $store.state?.auth?.user?.name }}!</strong></p>
|
|
4
|
-
<p>Your account has been verified successfully.</p>
|
|
5
|
-
|
|
6
|
-
<elButton
|
|
7
|
-
tag="router-link"
|
|
8
|
-
type="primary"
|
|
9
|
-
:to="{name: $store.state.auth.redirect}"
|
|
10
|
-
>
|
|
11
|
-
<span v-text="'Continue'" />
|
|
12
|
-
</elButton>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
mounted(){
|
|
18
|
-
this.$store.commit("setAuth", true);
|
|
19
|
-
|
|
20
|
-
this.$store.dispatch("getUser", {
|
|
21
|
-
errors: this.$root.errors,
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
components: {
|
|
25
|
-
elButton: require('../../basic/Button.vue').default,
|
|
26
|
-
}
|
|
27
|
-
// Problem in this file
|
|
28
|
-
};
|
|
29
|
-
</script>
|
package/Icon.vue
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="vel-icon">
|
|
3
|
-
<VSvg v-bind="$props" />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import VSvg from "./Svg.vue";
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
props: {
|
|
12
|
-
name: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
embed: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: false,
|
|
19
|
-
},
|
|
20
|
-
asis: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false,
|
|
23
|
-
},
|
|
24
|
-
artboard: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
components: {
|
|
30
|
-
VSvg
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
</script>
|
package/Svg.vue
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="embed">
|
|
4
|
-
<component v-if="embed" :is="icon" class="vel-svg"/>
|
|
5
|
-
</div>
|
|
6
|
-
<svg v-else class="vel-svg">
|
|
7
|
-
<use :xlink:href="'#' + name" />
|
|
8
|
-
</svg>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import { defineAsyncComponent } from 'vue';
|
|
13
|
-
export default {
|
|
14
|
-
|
|
15
|
-
props: {
|
|
16
|
-
name: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
embed: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false,
|
|
23
|
-
},
|
|
24
|
-
asis: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
data() {
|
|
30
|
-
return {
|
|
31
|
-
icons: import.meta.glob(`../../handlebars/generated/embed/**/*.svg`, { query: '?component' })
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
computed: {
|
|
35
|
-
icon() {
|
|
36
|
-
return defineAsyncComponent(() => this.icons[`../../handlebars/generated/embed/svg${this.asis ? '--asis' : ''}--${this.name}.svg`]())
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
</script>
|
package/components/_input.scss
DELETED
|
File without changes
|