@fishawack/lab-velocity 1.11.1 → 2.0.0-beta.2

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