@fishawack/lab-velocity 2.0.0-beta.6 → 2.0.0-beta.60

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 (111) hide show
  1. package/README.md +467 -36
  2. package/_Build/js/libs/build-id.js +14 -0
  3. package/_Build/js/libs/filters.js +36 -0
  4. package/_Build/js/libs/globals.js +7 -0
  5. package/_Build/js/libs/router.js +22 -0
  6. package/_Build/js/libs/routes.js +29 -0
  7. package/_Build/js/libs/store.js +21 -0
  8. package/_Build/js/libs/utility.js +161 -0
  9. package/_Build/vue/components/basic/Button.vue +1 -1
  10. package/_Build/vue/components/form/Avatar.vue +90 -0
  11. package/_Build/vue/components/form/Checkbox.vue +10 -0
  12. package/_Build/vue/components/form/InputNumber.vue +1 -1
  13. package/_Build/vue/components/form/Select.vue +221 -31
  14. package/_Build/vue/components/form/Wysiwyg2.vue +87 -2
  15. package/_Build/vue/components/form/wysiwyg2-video.js +41 -0
  16. package/_Build/vue/components/layout/Alert.vue +5 -5
  17. package/_Build/vue/components/layout/Audit.vue +158 -0
  18. package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +4 -4
  19. package/_Build/vue/{modules/AuthModule/components → components/layout}/Chips.vue +2 -2
  20. package/_Build/vue/components/layout/Footer.vue +11 -10
  21. package/_Build/vue/{modules/AuthModule/components/VFormFooter.vue → components/layout/FormFooter.vue} +2 -2
  22. package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +8 -8
  23. package/_Build/vue/components/layout/Layout.vue +94 -0
  24. package/_Build/vue/components/layout/Navigation.vue +83 -0
  25. package/_Build/vue/{modules/AuthModule/components/VPageHeader.vue → components/layout/PageHeader.vue} +14 -8
  26. package/_Build/vue/components/layout/SideBar.vue +26 -0
  27. package/_Build/vue/{modules/AuthModule/components/VTable.vue → components/layout/Table.vue} +24 -12
  28. package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +92 -48
  29. package/_Build/vue/components/layout/TokenDisplay.vue +52 -0
  30. package/_Build/vue/components/layout/pageTitle.vue +1 -1
  31. package/_Build/vue/components/navigation/Menu.vue +6 -1
  32. package/_Build/vue/components/navigation/MenuItem.vue +7 -2
  33. package/_Build/vue/components/navigation/MenuItemGroup.vue +7 -2
  34. package/_Build/vue/modules/AuthModule/js/axios.js +21 -1
  35. package/_Build/vue/modules/AuthModule/js/clear-cookies.js +34 -0
  36. package/_Build/vue/modules/AuthModule/js/guest-request.js +32 -0
  37. package/_Build/vue/modules/AuthModule/js/impersonation-banner.js +102 -0
  38. package/_Build/vue/modules/AuthModule/js/router.js +91 -114
  39. package/_Build/vue/modules/AuthModule/js/store.js +23 -6
  40. package/_Build/vue/modules/AuthModule/routes/PCompanies/columns.js +268 -0
  41. package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +213 -0
  42. package/_Build/vue/modules/AuthModule/routes/PIntegrations/columns.js +58 -0
  43. package/_Build/vue/modules/AuthModule/routes/PIntegrations/resource.js +79 -0
  44. package/_Build/vue/modules/AuthModule/routes/PTeams/columns.js +78 -0
  45. package/_Build/vue/modules/AuthModule/routes/PTeams/resource.js +251 -0
  46. package/_Build/vue/modules/AuthModule/routes/PUsers/SetPasswordAction.vue +51 -0
  47. package/_Build/vue/modules/AuthModule/routes/PUsers/SetPasswordDialog.vue +138 -0
  48. package/_Build/vue/modules/AuthModule/routes/PUsers/columns.js +349 -0
  49. package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +239 -0
  50. package/_Build/vue/modules/AuthModule/routes/account-exists.vue +2 -2
  51. package/_Build/vue/modules/AuthModule/routes/change-password.vue +28 -32
  52. package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
  53. package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +4 -4
  54. package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +10 -9
  55. package/_Build/vue/modules/AuthModule/routes/force-reset.vue +44 -58
  56. package/_Build/vue/modules/AuthModule/routes/forgot.vue +10 -5
  57. package/_Build/vue/modules/AuthModule/routes/login.vue +12 -19
  58. package/_Build/vue/modules/AuthModule/routes/logincallback.vue +1 -3
  59. package/_Build/vue/modules/AuthModule/routes/loginsso.vue +14 -10
  60. package/_Build/vue/modules/AuthModule/routes/logout.vue +14 -5
  61. package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +16 -5
  62. package/_Build/vue/modules/AuthModule/routes/register.vue +24 -28
  63. package/_Build/vue/modules/AuthModule/routes/reset.vue +20 -14
  64. package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +14 -8
  65. package/_Build/vue/modules/AuthModule/routes/success-reset.vue +2 -2
  66. package/_Build/vue/modules/AuthModule/routes/success-verify.vue +1 -3
  67. package/_Build/vue/modules/AuthModule/routes/verify.vue +11 -14
  68. package/_Build/vue/modules/resource/Children/create.vue +99 -0
  69. package/_Build/vue/modules/resource/Children/edit.vue +124 -0
  70. package/_Build/vue/modules/resource/Children/index.vue +42 -0
  71. package/_Build/vue/modules/resource/Children/partials/form.vue +111 -0
  72. package/_Build/vue/modules/resource/Children/show.vue +170 -0
  73. package/_Build/vue/modules/resource/index.js +562 -0
  74. package/_Build/vue/modules/resource/parent.vue +63 -0
  75. package/_Build/vue/modules/resource/trashable.js +104 -0
  76. package/_base.scss +0 -1
  77. package/_defaults.scss +2 -2
  78. package/components/_auth.scss +19 -61
  79. package/components/_datepicker.scss +1 -0
  80. package/components/_descriptions.scss +2 -0
  81. package/components/_footer.scss +1 -0
  82. package/components/_form.scss +18 -0
  83. package/components/_header.scss +3 -27
  84. package/components/_layout.scss +56 -0
  85. package/components/_menu.scss +0 -5
  86. package/components/_sidebar.scss +12 -27
  87. package/components/_table.scss +3 -0
  88. package/components/_token-display.scss +41 -0
  89. package/components/_wysiwyg2.scss +10 -0
  90. package/general.scss +1 -0
  91. package/index.js +31 -1
  92. package/package.json +7 -4
  93. package/_Build/vue/components/layout/sideBar.vue +0 -25
  94. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -259
  95. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +0 -62
  96. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +0 -98
  97. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +0 -90
  98. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +0 -181
  99. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +0 -266
  100. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
  101. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -112
  102. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -103
  103. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
  104. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +0 -173
  105. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -123
  106. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +0 -36
  107. package/components/_input.scss +0 -0
  108. /package/_Build/vue/{modules/AuthModule/components → components/layout}/AuthModal.vue +0 -0
  109. /package/_Build/vue/{modules/AuthModule/components → components/layout}/Chip.vue +0 -0
  110. /package/_Build/vue/{modules/AuthModule/components/VPasswordValidation.vue → components/layout/PasswordValidation.vue} +0 -0
  111. /package/_Build/vue/{modules/AuthModule/components/VRoleLegend.vue → components/layout/RoleLegend.vue} +0 -0
@@ -7,13 +7,13 @@
7
7
  />
8
8
  <form class="form" @submit.prevent="submit">
9
9
  <div v-if="!form.successful">
10
- <p class="AM-mt-2 AM-mb-0">
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="AM-mt-3"
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="AM-mt-2 AM-mb-2"
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
- <VPasswordValidation
39
+ <VelPasswordValidation
40
40
  :password="form.password"
41
41
  @passwordValid="updatePasswordValidity"
42
42
  />
43
- <div class="flex AM-mt-3">
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 class="" type="secondary" @click="handleButton">
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>
@@ -77,8 +81,17 @@
77
81
 
78
82
  <script>
79
83
  import Form from "form-backend-validation";
84
+ import { guestRequest } from "../js/guest-request";
80
85
 
81
86
  export default {
87
+ components: {
88
+ VelPasswordValidation:
89
+ require("../../../components/layout/PasswordValidation.vue")
90
+ .default,
91
+ elInput: require("../../../components/form/basic.vue").default,
92
+ elButton: require("../../../components/basic/Button.vue").default,
93
+ },
94
+
82
95
  data() {
83
96
  return {
84
97
  form: new Form(
@@ -94,9 +107,7 @@ export default {
94
107
  },
95
108
 
96
109
  mounted() {
97
- this.$store.dispatch("getUser", {
98
- errors: this.$root.errors,
99
- });
110
+ this.$store.dispatch("getUser");
100
111
  },
101
112
 
102
113
  methods: {
@@ -107,7 +118,7 @@ export default {
107
118
  await this.form.put("/user/password");
108
119
  await this.login();
109
120
  } catch (e) {
110
- this.$root.errors(e);
121
+ console.log(e);
111
122
  } finally {
112
123
  this.loading = false;
113
124
  }
@@ -116,19 +127,13 @@ export default {
116
127
  this.loading = true;
117
128
 
118
129
  try {
119
- const res = await this.form.post("/login");
120
-
121
- if (res["logged-in"]) {
122
- try {
123
- await this.$store.dispatch("logout", {
124
- // errors: this.$root.errors,
125
- });
126
- } catch (e) {}
127
-
128
- await this.form.post("/login");
129
- }
130
+ await guestRequest({
131
+ form: this.form,
132
+ url: "/login",
133
+ store: this.$store,
134
+ });
130
135
  } catch (e) {
131
- this.$root.errors(e);
136
+ console.log(e);
132
137
  } finally {
133
138
  this.loading = false;
134
139
  this.postLogin();
@@ -143,9 +148,7 @@ export default {
143
148
  },
144
149
 
145
150
  async postLogin() {
146
- const { data: user } = await this.$store.dispatch("getUser", {
147
- errors: this.$root.errors,
148
- });
151
+ const { data: user } = await this.$store.dispatch("getUser");
149
152
  },
150
153
  },
151
154
 
@@ -154,12 +157,5 @@ export default {
154
157
  title: "Reset Password",
155
158
  };
156
159
  },
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
160
  };
165
161
  </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="logoName"
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="AM-mt-2 AM-mb-0 AM-color-highlight">
4
+ <p class="mt-2 mb-0 color-highlight">
5
5
  <strong class="">Email: {{ form?.email }}</strong>
6
6
  </p>
7
- <p class="AM-mt-0.5">
7
+ <p class="mt-0.5">
8
8
  For security, password reset requests are only
9
9
  <strong>active for 1&nbsp;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 AM-mt-3">
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
- this.$root.errors(e);
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="AM-mt-2 AM-mb-0 AM-color-highlight">
5
+ <p class="mt-2 mb-0 color-highlight">
6
6
  <strong class="">Email: {{ form?.email }}</strong>
7
7
  </p>
8
- <p class="AM-mt-0.5">
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="AM-mt-2 AM-mb-2.5 hidden"
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 AM-mt-3">
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: {
@@ -64,30 +65,30 @@ export default {
64
65
  this.notification = null;
65
66
  }
66
67
 
67
- await this.form.post("/email/verification-notification");
68
+ await this.form.post("/email/resend-verification");
68
69
 
69
- this.$notify.success({
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 = this.$notify({
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 = this.$notify({
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
- this.$root.errors(e);
91
+ console.log(e);
91
92
  }
92
93
  }
93
94
  },
@@ -1,21 +1,14 @@
1
1
  <template>
2
2
  <div class="relative">
3
3
  <section id="resetPasswordForm">
4
- <h1
5
- class="h2 h2--small"
6
- v-html="!form.successful ? 'Welcome' : 'Success'"
7
- />
4
+ <h1 class="h2 h2--small" v-html="'Welcome'" />
8
5
  <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
- >
6
+ <div>
7
+ <p class="mt-2 mb-0 color-highlight">
8
+ <strong class="">Email: {{ email }}</strong>
15
9
  </p>
16
- <p class="AM-mt-0.5">
17
- <strong
18
- >Hello {{ $store.state?.auth?.user?.name }}</strong
10
+ <p class="mt-0.5">
11
+ <strong>Hello {{ name }}</strong
19
12
  >, and welcome to {{ $root.appName }}. To maintain
20
13
  security, anyone signing in with a one-time-password
21
14
  must <strong>create a new password</strong> the first
@@ -23,7 +16,7 @@
23
16
  </p>
24
17
  <el-input
25
18
  v-model="form.password"
26
- class="AM-mt-2"
19
+ class="mt-2"
27
20
  label="New Password"
28
21
  placeholder="Enter new password"
29
22
  name="password"
@@ -33,31 +26,22 @@
33
26
  required
34
27
  />
35
28
 
36
- <VPasswordValidation
29
+ <VelPasswordValidation
37
30
  :password="form.password"
38
31
  @passwordValid="updatePasswordValidity"
39
32
  />
40
33
 
41
34
  <elButton
42
35
  native-type="submit"
43
- class="AM-mt-3"
36
+ class="mt-3"
44
37
  type="primary"
45
- :disabled="form.processing || !isPasswordValid"
46
- :loading="form.processing"
38
+ :disabled="loading || !isPasswordValid"
39
+ :loading="loading"
47
40
  @click="onSubmit"
48
41
  >
49
42
  <span v-text="'Update password'" />
50
43
  </elButton>
51
44
  </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
45
  </form>
62
46
  </section>
63
47
  </div>
@@ -65,8 +49,18 @@
65
49
 
66
50
  <script>
67
51
  import Form from "form-backend-validation";
52
+ import { ElNotification } from "element-plus";
53
+ import { guestRequest } from "../js/guest-request";
68
54
 
69
55
  export default {
56
+ components: {
57
+ VelPasswordValidation:
58
+ require("../../../components/layout/PasswordValidation.vue")
59
+ .default,
60
+ elInput: require("../../../components/form/basic.vue").default,
61
+ elButton: require("../../../components/basic/Button.vue").default,
62
+ },
63
+
70
64
  data() {
71
65
  return {
72
66
  form: new Form(
@@ -77,13 +71,17 @@ export default {
77
71
  { resetOnSuccess: false },
78
72
  ),
79
73
  isPasswordValid: false,
74
+ loading: false,
75
+ name: "",
76
+ email: "",
80
77
  };
81
78
  },
82
79
 
83
80
  mounted() {
84
- this.$store.dispatch("getUser", {
85
- errors: this.$root.errors,
86
- });
81
+ this.$store.dispatch("getUser");
82
+
83
+ this.name = this.$store.state?.auth?.user?.name;
84
+ this.email = this.$store.state?.auth?.user?.email;
87
85
  },
88
86
 
89
87
  methods: {
@@ -94,46 +92,41 @@ export default {
94
92
  await this.form.put("/user/password");
95
93
  await this.login();
96
94
  } catch (e) {
97
- this.$root.errors(e);
95
+ console.log(e);
98
96
  } finally {
99
97
  this.loading = false;
100
98
  }
101
99
  },
102
100
  async login() {
103
- this.loading = true;
104
-
105
101
  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
- }
102
+ await guestRequest({
103
+ form: this.form,
104
+ url: "/login",
105
+ store: this.$store,
106
+ });
117
107
  } catch (e) {
118
- this.$root.errors(e);
108
+ console.log(e);
119
109
  } finally {
120
- this.loading = false;
121
110
  await this.postLogin();
122
111
  }
123
112
  },
124
113
 
125
114
  async postLogin() {
126
- const { data: user } = await this.$store.dispatch("getUser", {
127
- errors: this.$root.errors,
115
+ const { data: user } = await this.$store.dispatch("getUser");
116
+
117
+ this.$router.push({ name: this.$store.state.auth.redirect });
118
+
119
+ ElNotification({
120
+ type: "success",
121
+ message: "Password updated successfully",
122
+ duration: 10000,
123
+ class: "el-notification--success el-notification--right-override",
128
124
  });
129
125
  },
130
126
 
131
127
  updatePasswordValidity(isValid) {
132
128
  this.isPasswordValid = isValid;
133
129
  },
134
- handleButton() {
135
- this.$emit("close");
136
- },
137
130
  },
138
131
 
139
132
  metaInfo() {
@@ -141,12 +134,5 @@ export default {
141
134
  title: "Reset Password",
142
135
  };
143
136
  },
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
137
  };
152
138
  </script>
@@ -3,14 +3,14 @@
3
3
  <section id="forgotPasswordForm">
4
4
  <h1 class="h2 h2--small">Reset password</h1>
5
5
  <form class="form" @submit.prevent="submit">
6
- <p class="AM-mt-2">
6
+ <p class="mt-2">
7
7
  Enter the email address associated with your account to
8
8
  continue.
9
9
  </p>
10
10
 
11
11
  <el-input
12
12
  v-if="!form.successful"
13
- class="AM-mt-3 AM-mb-3"
13
+ class="mt-3 mb-3"
14
14
  v-model="form.email"
15
15
  label="Email "
16
16
  placeholder="Enter email address"
@@ -32,7 +32,7 @@
32
32
  Continue
33
33
  </elButton>
34
34
 
35
- <p class="disclaimer AM-mt-3">
35
+ <p class="disclaimer mt-3">
36
36
  <router-link
37
37
  class="color-1 underline"
38
38
  :to="{ name: 'auth.login' }"
@@ -47,6 +47,7 @@
47
47
 
48
48
  <script>
49
49
  import Form from "form-backend-validation";
50
+ import { guestRequest } from "../js/guest-request";
50
51
 
51
52
  export default {
52
53
  components: {
@@ -66,14 +67,18 @@ export default {
66
67
  methods: {
67
68
  async onSubmit() {
68
69
  try {
69
- await this.form.post("/forgot-password");
70
+ await guestRequest({
71
+ form: this.form,
72
+ url: "/forgot-password",
73
+ store: this.$store,
74
+ });
70
75
 
71
76
  this.$router.push({
72
77
  name: "auth.success-forgot",
73
78
  query: { email: this.form.email },
74
79
  });
75
80
  } catch (e) {
76
- this.$root.errors(e);
81
+ console.log(e);
77
82
  }
78
83
  },
79
84
  },
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <h1 class="h2 h2--small">Sign in</h1>
3
- <p class="AM-mb-3 AM-mt-2">Enter your password to continue.</p>
3
+ <p class="mb-3 mt-2">Enter your password to continue.</p>
4
4
 
5
5
  <form @submit.prevent="submit" class="form" id="memberLoginForm">
6
6
  <el-input
7
- class="AM-mb-3"
7
+ class="mb-3"
8
8
  label="Email"
9
9
  placeholder="Enter your email address"
10
10
  name="email"
@@ -15,7 +15,7 @@
15
15
  />
16
16
 
17
17
  <el-input
18
- class="AM-mb-3"
18
+ class="mb-3"
19
19
  label="Password"
20
20
  placeholder="Enter your password"
21
21
  name="password"
@@ -47,7 +47,7 @@
47
47
  Continue
48
48
  </el-button>
49
49
 
50
- <p class="disclaimer AM-mt-3">
50
+ <p class="disclaimer mt-3">
51
51
  Having trouble signing in?
52
52
  <router-link
53
53
  class="color-1 underline"
@@ -65,6 +65,7 @@
65
65
 
66
66
  <script>
67
67
  import Form from "form-backend-validation";
68
+ import { guestRequest } from "../js/guest-request";
68
69
 
69
70
  export default {
70
71
  components: {
@@ -93,30 +94,22 @@ export default {
93
94
  this.loading = true;
94
95
 
95
96
  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
- }
97
+ const res = await guestRequest({
98
+ form: this.form,
99
+ url: "/login",
100
+ store: this.$store,
101
+ });
107
102
 
108
103
  await this.postLogin();
109
104
  } catch (e) {
110
- this.$root.errors(e);
105
+ console.log(e);
111
106
  } finally {
112
107
  this.loading = false;
113
108
  }
114
109
  },
115
110
 
116
111
  async postLogin() {
117
- const { data: user } = await this.$store.dispatch("getUser", {
118
- errors: this.$root.errors,
119
- });
112
+ const { data: user } = await this.$store.dispatch("getUser");
120
113
 
121
114
  if (window.dataLayer) {
122
115
  window.dataLayer.push({ event: "login", user });
@@ -16,9 +16,7 @@ export default {
16
16
 
17
17
  methods: {
18
18
  async postLogin() {
19
- const { data: user } = await this.$store.dispatch("getUser", {
20
- errors: this.$root.errors,
21
- });
19
+ const { data: user } = await this.$store.dispatch("getUser");
22
20
 
23
21
  if (window.dataLayer) {
24
22
  window.dataLayer.push({ event: "login", user });
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <template v-if="stage === 1">
3
3
  <h1 class="h2 h2--small">Sign in</h1>
4
- <p class="AM-mb-3 AM-mt-2">Enter your email address to continue.</p>
4
+ <p class="mb-3 mt-2">Enter your email address to continue.</p>
5
5
 
6
6
  <form @submit.prevent="submit" class="form" id="memberLoginForm">
7
7
  <el-input
8
- class="AM-mb-3"
8
+ class="mb-3"
9
9
  label="Email"
10
10
  placeholder="Enter your email address"
11
11
  name="email"
@@ -35,7 +35,7 @@
35
35
  Continue
36
36
  </el-button>
37
37
 
38
- <p class="disclaimer AM-mt-3">
38
+ <p class="disclaimer mt-3">
39
39
  Having trouble signing in?
40
40
  <a :href="$store.state.auth.contact" class="underline"
41
41
  >Contact us</a
@@ -45,13 +45,11 @@
45
45
  </template>
46
46
  <template v-else>
47
47
  <h1 class="h2 h2--small">Sign in with SSO</h1>
48
- <p class="AM-mt-2">
48
+ <p class="mt-2">
49
49
  Redirecting you to your organisation’s Single Sign-On (SSO) gateway
50
- <span class="AM-color-highlight"
51
- >in {{ countdown }} seconds...</span
52
- >
50
+ <span class="color-highlight">in {{ countdown }} seconds...</span>
53
51
  </p>
54
- <p class="disclaimer AM-mt-3">
52
+ <p class="disclaimer mt-3">
55
53
  <a :href="redirect_url" class="underline">Go to SSO gateway</a>
56
54
  </p>
57
55
  </template>
@@ -59,6 +57,7 @@
59
57
 
60
58
  <script>
61
59
  import Form from "form-backend-validation";
60
+ import { guestRequest } from "../js/guest-request";
62
61
 
63
62
  export default {
64
63
  components: {
@@ -89,7 +88,12 @@ export default {
89
88
  this.loading = true;
90
89
 
91
90
  try {
92
- const res = await this.form.post(`/hydrate/sso/check`);
91
+ const res = await guestRequest({
92
+ form: this.form,
93
+ url: "/hydrate/sso/check",
94
+ store: this.$store,
95
+ });
96
+
93
97
  if (res["redirect_url"]) {
94
98
  this.redirect_url = res["redirect_url"];
95
99
  this.setRedirect();
@@ -100,7 +104,7 @@ export default {
100
104
  });
101
105
  }
102
106
  } catch (e) {
103
- this.$root.errors(e);
107
+ console.log(e);
104
108
  } finally {
105
109
  this.loading = false;
106
110
  }