@fishawack/lab-velocity 2.0.0-beta.1 → 2.0.0-beta.3

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.
Files changed (112) hide show
  1. package/_Build/vue/components/Icon.vue +33 -0
  2. package/_Build/vue/components/Svg.vue +45 -0
  3. package/_Build/vue/components/basic/Button.vue +109 -0
  4. package/_Build/vue/components/basic/link.vue +64 -0
  5. package/_Build/vue/components/form/Cascader.vue +85 -0
  6. package/_Build/vue/components/form/Checkbox.vue +39 -0
  7. package/_Build/vue/components/form/CheckboxGroup.vue +91 -0
  8. package/_Build/vue/components/form/DatePicker.vue +116 -0
  9. package/_Build/vue/components/form/InputNumber.vue +89 -0
  10. package/_Build/vue/components/form/Select.vue +109 -0
  11. package/_Build/vue/components/form/Switch.vue +63 -0
  12. package/_Build/vue/components/form/Upload.vue +101 -0
  13. package/_Build/vue/components/form/Wysiwyg.vue +127 -0
  14. package/_Build/vue/components/form/Wysiwyg2.vue +577 -0
  15. package/_Build/vue/components/form/basic.vue +106 -0
  16. package/_Build/vue/components/form/color.vue +22 -0
  17. package/_Build/vue/components/form/file.vue +89 -0
  18. package/_Build/vue/components/form/input.js +79 -0
  19. package/_Build/vue/components/form/input.vue +105 -0
  20. package/_Build/vue/components/layout/Alert.vue +38 -0
  21. package/_Build/vue/components/layout/Footer.vue +50 -0
  22. package/_Build/vue/components/layout/Header.vue +13 -0
  23. package/_Build/vue/components/layout/Loader.vue +59 -0
  24. package/_Build/vue/components/layout/Tooltip.vue +46 -0
  25. package/_Build/vue/components/layout/pageTitle.vue +18 -0
  26. package/_Build/vue/components/layout/sideBar.vue +25 -0
  27. package/_Build/vue/components/navigation/Breadcrumbs.vue +37 -0
  28. package/_Build/vue/components/navigation/BreadcrumbsItem.vue +19 -0
  29. package/_Build/vue/components/navigation/Menu.vue +14 -0
  30. package/_Build/vue/components/navigation/MenuItem.vue +20 -0
  31. package/_Build/vue/components/navigation/MenuItemGroup.vue +20 -0
  32. package/_Build/vue/components/navigation/SubMenu.vue +20 -0
  33. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +251 -0
  34. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +62 -0
  35. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +98 -0
  36. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +90 -0
  37. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +173 -0
  38. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +262 -0
  39. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +36 -0
  40. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +112 -0
  41. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +103 -0
  42. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +112 -0
  43. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +169 -0
  44. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +120 -0
  45. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +36 -0
  46. package/_Build/vue/modules/AuthModule/components/AuthModal.vue +105 -0
  47. package/_Build/vue/modules/AuthModule/components/Chip.vue +70 -0
  48. package/_Build/vue/modules/AuthModule/components/Chips.vue +26 -0
  49. package/_Build/vue/modules/AuthModule/components/FormRole.vue +115 -0
  50. package/_Build/vue/modules/AuthModule/components/VBreadcrumbs.vue +33 -0
  51. package/_Build/vue/modules/AuthModule/components/VFormFooter.vue +46 -0
  52. package/_Build/vue/modules/AuthModule/components/VPageHeader.vue +38 -0
  53. package/_Build/vue/modules/AuthModule/components/VPasswordValidation.vue +106 -0
  54. package/_Build/vue/modules/AuthModule/components/VRoleLegend.vue +43 -0
  55. package/_Build/vue/modules/AuthModule/components/VTable.vue +127 -0
  56. package/_Build/vue/modules/AuthModule/components/VTableSorter.vue +240 -0
  57. package/_Build/vue/modules/AuthModule/js/FakeAPI.js +78 -0
  58. package/_Build/vue/modules/AuthModule/js/axios.js +62 -0
  59. package/_Build/vue/modules/AuthModule/js/router.js +295 -0
  60. package/_Build/vue/modules/AuthModule/js/store.js +62 -0
  61. package/_Build/vue/modules/AuthModule/routes/account-exists.vue +33 -0
  62. package/_Build/vue/modules/AuthModule/routes/change-password.vue +165 -0
  63. package/_Build/vue/modules/AuthModule/routes/container.vue +34 -0
  64. package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +78 -0
  65. package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +100 -0
  66. package/_Build/vue/modules/AuthModule/routes/force-reset.vue +152 -0
  67. package/_Build/vue/modules/AuthModule/routes/forgot.vue +91 -0
  68. package/_Build/vue/modules/AuthModule/routes/login.vue +143 -0
  69. package/_Build/vue/modules/AuthModule/routes/logincallback.vue +41 -0
  70. package/_Build/vue/modules/AuthModule/routes/loginheadless.vue +21 -0
  71. package/_Build/vue/modules/AuthModule/routes/loginsso.vue +134 -0
  72. package/_Build/vue/modules/AuthModule/routes/logout.vue +21 -0
  73. package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +27 -0
  74. package/_Build/vue/modules/AuthModule/routes/register.vue +174 -0
  75. package/_Build/vue/modules/AuthModule/routes/reset.vue +133 -0
  76. package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +119 -0
  77. package/_Build/vue/modules/AuthModule/routes/success-reset.vue +35 -0
  78. package/_Build/vue/modules/AuthModule/routes/success-verify.vue +32 -0
  79. package/_Build/vue/modules/AuthModule/routes/verify.vue +113 -0
  80. package/package.json +3 -9
  81. package/components/_alert.scss +0 -5
  82. package/components/_basic.scss +0 -55
  83. package/components/_breadcrumbs.scss +0 -39
  84. package/components/_button.scss +0 -304
  85. package/components/_cascader.scss +0 -12
  86. package/components/_checkbox.scss +0 -41
  87. package/components/_chip.scss +0 -24
  88. package/components/_collapse.scss +0 -24
  89. package/components/_datepicker.scss +0 -52
  90. package/components/_footer.scss +0 -46
  91. package/components/_form.scss +0 -24
  92. package/components/_header.scss +0 -54
  93. package/components/_icon.scss +0 -25
  94. package/components/_input.scss +0 -0
  95. package/components/_inputNumber.scss +0 -22
  96. package/components/_link.scss +0 -44
  97. package/components/_loader.scss +0 -43
  98. package/components/_menu.scss +0 -112
  99. package/components/_pageTitle.scss +0 -8
  100. package/components/_permissionLegend.scss +0 -18
  101. package/components/_select.scss +0 -29
  102. package/components/_sidebar.scss +0 -56
  103. package/components/_switch.scss +0 -14
  104. package/components/_table.scss +0 -20
  105. package/components/_tooltip.scss +0 -4
  106. package/components/_typography.scss +0 -162
  107. package/components/_upload.scss +0 -15
  108. package/components/_wysiwyg.scss +0 -7
  109. package/components/_wysiwyg2.scss +0 -142
  110. package/modules/_AuthModule.scss +0 -212
  111. package/modules/_AuthVariables.scss +0 -7
  112. package/modules/_modal.scss +0 -24
@@ -0,0 +1,78 @@
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
9
+ <strong>active for 1&nbsp;hour</strong>. If you still want to reset your
10
+ password, please request a new password reset-link.
11
+ </p>
12
+
13
+ <form class="form" @submit.prevent="submit">
14
+ <el-input
15
+ class="hidden"
16
+ v-model="form.email"
17
+ label="Email address"
18
+ name="email"
19
+ :error="form.errors"
20
+ type="email"
21
+ placeholder="Email "
22
+ required
23
+ />
24
+ <elButton
25
+ native-type="submit"
26
+ type="primary"
27
+ :disabled="form.processing"
28
+ :loading="form.processing"
29
+ @click="onSubmit"
30
+ >
31
+ Request new reset-link
32
+ </elButton>
33
+
34
+ <p class="disclaimer AM-mt-3">
35
+ <router-link class="color-1 underline" :to="{ name: 'auth.login' }">
36
+ Back to Sign in
37
+ </router-link>
38
+ </p>
39
+ </form>
40
+ </template>
41
+
42
+ <script>
43
+ import Form from "form-backend-validation";
44
+
45
+ export default {
46
+ components: {
47
+ elInput: require("../../../components/form/basic.vue").default,
48
+ elButton: require("../../../components/basic/Button.vue").default,
49
+ },
50
+ data: () => ({
51
+ form: new Form(
52
+ {
53
+ email: "",
54
+ },
55
+ { resetOnSuccess: false },
56
+ ),
57
+ }),
58
+
59
+ methods: {
60
+ async onSubmit() {
61
+ try {
62
+ await this.form.post("/forgot-password");
63
+
64
+ this.$router.push({
65
+ name: "auth.success-forgot",
66
+ query: { email: this.form.email },
67
+ });
68
+ } catch (e) {
69
+ this.$root.errors(e);
70
+ }
71
+ },
72
+ },
73
+
74
+ mounted() {
75
+ this.form.email = this.$route.query.email;
76
+ },
77
+ };
78
+ </script>
@@ -0,0 +1,100 @@
1
+ <template>
2
+ <h1 class="h2 h2--small">Verification link expired</h1>
3
+
4
+ <form class="form" @submit.prevent="submit">
5
+ <p class="AM-mt-2 AM-mb-0 AM-color-highlight">
6
+ <strong class="">Email: {{ form?.email }}</strong>
7
+ </p>
8
+ <p class="AM-mt-0.5">
9
+ This email verification link has expired. Not to worry, we can email
10
+ you a new one.
11
+ </p>
12
+
13
+ <el-input
14
+ class="AM-mt-2 AM-mb-2.5 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
+
24
+ <elButton
25
+ native-type="submit"
26
+ type="primary"
27
+ :disabled="form.processing"
28
+ :loading="form.processing"
29
+ @click="onSubmit"
30
+ >
31
+ Re-send verification link
32
+ </elButton>
33
+ </form>
34
+
35
+ <p class="disclaimer AM-mt-3">
36
+ Having trouble singing in?
37
+ <a :href="$store.state.auth.contact" class="underline">Contact us</a>
38
+ </p>
39
+ </template>
40
+
41
+ <script>
42
+ import Form from "form-backend-validation";
43
+
44
+ export default {
45
+ components: {
46
+ elInput: require("../../../components/form/basic.vue").default,
47
+ elButton: require("../../../components/basic/Button.vue").default,
48
+ },
49
+ data: () => ({
50
+ form: new Form(
51
+ {
52
+ email: "",
53
+ },
54
+ { resetOnSuccess: false },
55
+ ),
56
+ notification: null,
57
+ }),
58
+
59
+ methods: {
60
+ async onSubmit() {
61
+ try {
62
+ if (this.notification) {
63
+ this.notification.close();
64
+ this.notification = null;
65
+ }
66
+
67
+ await this.form.post("/email/verification-notification");
68
+
69
+ this.$notify.success({
70
+ message: "Email has been re-sent",
71
+ duration: 10000,
72
+ class: "el-notification--success el-notification--right-override",
73
+ });
74
+ } catch (e) {
75
+ if (e.response && e.response.status === 429) {
76
+ this.notification = this.$notify({
77
+ type: "warning",
78
+ message: "Please allow 10 minutes before re-requesting",
79
+ duration: 0,
80
+ class: "el-notification--warning el-notification--right-override",
81
+ });
82
+ } else if (e.response && e.response.status === 422) {
83
+ this.notification = this.$notify({
84
+ type: "error",
85
+ message: e.response.data.message,
86
+ duration: 0,
87
+ class: "el-notification--error el-notification--right-override",
88
+ });
89
+ } else {
90
+ this.$root.errors(e);
91
+ }
92
+ }
93
+ },
94
+ },
95
+
96
+ async mounted() {
97
+ this.form.email = this.$route.query.email;
98
+ },
99
+ };
100
+ </script>
@@ -0,0 +1,152 @@
1
+ <template>
2
+ <div class="relative">
3
+ <section id="resetPasswordForm">
4
+ <h1
5
+ class="h2 h2--small"
6
+ v-html="!form.successful ? 'Welcome' : 'Success'"
7
+ />
8
+ <form class="form" @submit.prevent="submit">
9
+ <div v-if="!form.successful">
10
+ <p class="AM-mt-2 AM-mb-0 AM-color-highlight">
11
+ <strong class=""
12
+ >Email:
13
+ {{ $store.state?.auth?.user?.email }}</strong
14
+ >
15
+ </p>
16
+ <p class="AM-mt-0.5">
17
+ <strong
18
+ >Hello {{ $store.state?.auth?.user?.name }}</strong
19
+ >, and welcome to {{ $root.appName }}. To maintain
20
+ security, anyone signing in with a one-time-password
21
+ must <strong>create a new password</strong> the first
22
+ time they access the {{ $root.appName }} portal.
23
+ </p>
24
+ <el-input
25
+ v-model="form.password"
26
+ class="AM-mt-2"
27
+ label="New Password"
28
+ placeholder="Enter new password"
29
+ name="password"
30
+ :error="form.errors"
31
+ type="password"
32
+ autocomplete="new-password"
33
+ required
34
+ />
35
+
36
+ <VPasswordValidation
37
+ :password="form.password"
38
+ @passwordValid="updatePasswordValidity"
39
+ />
40
+
41
+ <elButton
42
+ native-type="submit"
43
+ class="AM-mt-3"
44
+ type="primary"
45
+ :disabled="form.processing || !isPasswordValid"
46
+ :loading="form.processing"
47
+ @click="onSubmit"
48
+ >
49
+ <span v-text="'Update password'" />
50
+ </elButton>
51
+ </div>
52
+ <div v-else>
53
+ <strong class=""
54
+ >Email: {{ $store.state.auth?.user?.email }}</strong
55
+ >
56
+ <p v-text="`Your password has been updated.`" />
57
+ <elButton type="primary" @click="handleButton">
58
+ Continue
59
+ </elButton>
60
+ </div>
61
+ </form>
62
+ </section>
63
+ </div>
64
+ </template>
65
+
66
+ <script>
67
+ import Form from "form-backend-validation";
68
+
69
+ export default {
70
+ data() {
71
+ return {
72
+ form: new Form(
73
+ {
74
+ email: this.$store.state.auth.user?.email,
75
+ password: "",
76
+ },
77
+ { resetOnSuccess: false },
78
+ ),
79
+ isPasswordValid: false,
80
+ };
81
+ },
82
+
83
+ mounted() {
84
+ this.$store.dispatch("getUser", {
85
+ errors: this.$root.errors,
86
+ });
87
+ },
88
+
89
+ methods: {
90
+ async onSubmit() {
91
+ this.loading = true;
92
+
93
+ try {
94
+ await this.form.put("/user/password");
95
+ await this.login();
96
+ } catch (e) {
97
+ this.$root.errors(e);
98
+ } finally {
99
+ this.loading = false;
100
+ }
101
+ },
102
+ async login() {
103
+ this.loading = true;
104
+
105
+ try {
106
+ const res = await this.form.post("/login");
107
+
108
+ if (res["logged-in"]) {
109
+ try {
110
+ await this.$store.dispatch("logout", {
111
+ errors: this.$root.errors,
112
+ });
113
+ } catch (e) {}
114
+
115
+ await this.form.post("/login");
116
+ }
117
+ } catch (e) {
118
+ this.$root.errors(e);
119
+ } finally {
120
+ this.loading = false;
121
+ await this.postLogin();
122
+ }
123
+ },
124
+
125
+ async postLogin() {
126
+ const { data: user } = await this.$store.dispatch("getUser", {
127
+ errors: this.$root.errors,
128
+ });
129
+ },
130
+
131
+ updatePasswordValidity(isValid) {
132
+ this.isPasswordValid = isValid;
133
+ },
134
+ handleButton() {
135
+ this.$emit("close");
136
+ },
137
+ },
138
+
139
+ metaInfo() {
140
+ return {
141
+ title: "Reset Password",
142
+ };
143
+ },
144
+
145
+ components: {
146
+ VPasswordValidation: require("./../components/VPasswordValidation.vue")
147
+ .default,
148
+ elInput: require("../../../components/form/basic.vue").default,
149
+ elButton: require("../../../components/basic/Button.vue").default,
150
+ },
151
+ };
152
+ </script>
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div class="relative">
3
+ <section id="forgotPasswordForm">
4
+ <h1 class="h2 h2--small">Reset password</h1>
5
+ <form class="form" @submit.prevent="submit">
6
+ <p class="AM-mt-2">
7
+ Enter the email address associated with your account to
8
+ continue.
9
+ </p>
10
+
11
+ <el-input
12
+ v-if="!form.successful"
13
+ class="AM-mt-3 AM-mb-3"
14
+ v-model="form.email"
15
+ label="Email "
16
+ placeholder="Enter email address"
17
+ name="email"
18
+ :error="form.errors"
19
+ type="email"
20
+ required
21
+ />
22
+
23
+ <elButton
24
+ native-type="submit"
25
+ type="primary"
26
+ :disabled="
27
+ form.processing || !form.email || form.email?.length < 5
28
+ "
29
+ :loading="form.processing"
30
+ @click="onSubmit"
31
+ >
32
+ Continue
33
+ </elButton>
34
+
35
+ <p class="disclaimer AM-mt-3">
36
+ <router-link
37
+ class="color-1 underline"
38
+ :to="{ name: 'auth.login' }"
39
+ >
40
+ Back to Sign in
41
+ </router-link>
42
+ </p>
43
+ </form>
44
+ </section>
45
+ </div>
46
+ </template>
47
+
48
+ <script>
49
+ import Form from "form-backend-validation";
50
+
51
+ export default {
52
+ components: {
53
+ elInput: require("../../../components/form/basic.vue").default,
54
+ elButton: require("../../../components/basic/Button.vue").default,
55
+ },
56
+
57
+ data: () => ({
58
+ form: new Form(
59
+ {
60
+ email: "",
61
+ },
62
+ { resetOnSuccess: false },
63
+ ),
64
+ }),
65
+
66
+ methods: {
67
+ async onSubmit() {
68
+ try {
69
+ await this.form.post("/forgot-password");
70
+
71
+ this.$router.push({
72
+ name: "auth.success-forgot",
73
+ query: { email: this.form.email },
74
+ });
75
+ } catch (e) {
76
+ this.$root.errors(e);
77
+ }
78
+ },
79
+ },
80
+
81
+ mounted() {
82
+ this.form.email = this.$route.query.email;
83
+ },
84
+
85
+ metaInfo() {
86
+ return {
87
+ title: "Forgot Password",
88
+ };
89
+ },
90
+ };
91
+ </script>
@@ -0,0 +1,143 @@
1
+ <template>
2
+ <h1 class="h2 h2--small">Sign in</h1>
3
+ <p class="AM-mb-3 AM-mt-2">Enter your password to continue.</p>
4
+
5
+ <form @submit.prevent="submit" class="form" id="memberLoginForm">
6
+ <el-input
7
+ class="AM-mb-3"
8
+ label="Email"
9
+ placeholder="Enter your email address"
10
+ name="email"
11
+ type="email"
12
+ required
13
+ v-model="form.email"
14
+ :error="form.errors"
15
+ />
16
+
17
+ <el-input
18
+ class="AM-mb-3"
19
+ label="Password"
20
+ placeholder="Enter your password"
21
+ name="password"
22
+ type="password"
23
+ required
24
+ v-model="form.password"
25
+ :error="form.errors"
26
+ />
27
+
28
+ <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
29
+ <div style="position: absolute; left: -5000px" aria-hidden="true">
30
+ <input
31
+ ref="honeypot"
32
+ type="text"
33
+ name="b_0e1715593ad9366bc5d3ad8be_7aca058f12"
34
+ tabindex="-1"
35
+ value=""
36
+ />
37
+ </div>
38
+
39
+ <el-button
40
+ native-type="submit"
41
+ type="primary"
42
+ :disabled="
43
+ loading || form.email?.length < 5 || form.password?.length < 8
44
+ "
45
+ @click="onSubmit"
46
+ >
47
+ Continue
48
+ </el-button>
49
+
50
+ <p class="disclaimer AM-mt-3">
51
+ Having trouble signing in?
52
+ <router-link
53
+ class="color-1 underline"
54
+ :to="{ name: 'auth.forgot' }"
55
+ >
56
+ Reset password
57
+ </router-link>
58
+ or
59
+ <a :href="$store.state.auth.contact" class="underline"
60
+ >Contact us</a
61
+ >
62
+ </p>
63
+ </form>
64
+ </template>
65
+
66
+ <script>
67
+ import Form from "form-backend-validation";
68
+
69
+ export default {
70
+ components: {
71
+ elInput: require("../../../components/form/basic.vue").default,
72
+ elButton: require("../../../components/basic/Button.vue").default,
73
+ },
74
+ data() {
75
+ return {
76
+ form: new Form(
77
+ {
78
+ email: this.$route.query.email ?? "",
79
+ password: "",
80
+ device_name: "Mobile device",
81
+ remember: true,
82
+ },
83
+ { resetOnSuccess: false },
84
+ ),
85
+ loading: false,
86
+ };
87
+ },
88
+
89
+ methods: {
90
+ async onSubmit() {
91
+ if (this.loading) return;
92
+
93
+ this.loading = true;
94
+
95
+ try {
96
+ const res = await this.form.post("/login");
97
+
98
+ if (res["logged-in"]) {
99
+ try {
100
+ await this.$store.dispatch("logout", {
101
+ errors: this.$root.errors,
102
+ });
103
+ } catch (e) {}
104
+
105
+ await this.form.post("/login");
106
+ }
107
+
108
+ await this.postLogin();
109
+ } catch (e) {
110
+ this.$root.errors(e);
111
+ } finally {
112
+ this.loading = false;
113
+ }
114
+ },
115
+
116
+ async postLogin() {
117
+ const { data: user } = await this.$store.dispatch("getUser", {
118
+ errors: this.$root.errors,
119
+ });
120
+
121
+ if (window.dataLayer) {
122
+ window.dataLayer.push({ event: "login", user });
123
+ }
124
+
125
+ if (this.$store.state.auth.intended) {
126
+ this.$router.push(this.$store.state.auth.intended);
127
+ } else {
128
+ this.$router.push({
129
+ name: this.$store.state.auth.redirect,
130
+ });
131
+ }
132
+
133
+ this.$store.commit("setIntended", null);
134
+ },
135
+ },
136
+
137
+ mounted() {
138
+ if (this.$route.query.authenticated) {
139
+ this.postLogin();
140
+ }
141
+ },
142
+ };
143
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <!-- Set Spinner -->
3
+ <div class="mx-auto">
4
+ <VLoader class="mx-auto" />
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ components: {
11
+ VLoader: require("../../layout/Loader.vue").default,
12
+ },
13
+ data() {
14
+ return {};
15
+ },
16
+
17
+ methods: {
18
+ async postLogin() {
19
+ const { data: user } = await this.$store.dispatch("getUser", {
20
+ errors: this.$root.errors,
21
+ });
22
+
23
+ if (window.dataLayer) {
24
+ window.dataLayer.push({ event: "login", user });
25
+ }
26
+
27
+ if (this.$store.state.auth.intended) {
28
+ this.$router.push(this.$store.state.auth.intended);
29
+ } else {
30
+ this.$router.push({ name: this.$store.state.auth.redirect });
31
+ }
32
+
33
+ this.$store.commit("setIntended", null);
34
+ },
35
+ },
36
+
37
+ mounted() {
38
+ this.postLogin();
39
+ },
40
+ };
41
+ </script>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <!-- Set Spinner -->
3
+ <div class="mx-auto">
4
+ <VLoader class="mx-auto" />
5
+ <p v-text="`Logging in...`" />
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ mounted() {
12
+ const { authenticated } = this.$store.getters;
13
+
14
+ if (!authenticated) {
15
+ window.location = `${process.env.APP_URL}/hydrate/sso/redirect`;
16
+ } else {
17
+ window.location = `${process.env.APP_URL}/`;
18
+ }
19
+ },
20
+ };
21
+ </script>