@fishawack/lab-velocity 1.3.2 → 1.4.0

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.
@@ -24,6 +24,14 @@ export function authRoutes(node, store, nested = 'auth') {
24
24
  .default,
25
25
  name: `${nested}.login`
26
26
  },
27
+ {
28
+ path: "force-login",
29
+ component: node
30
+ ? ""
31
+ : require("../routes/loginheadless.vue")
32
+ .default,
33
+ name: `${nested}.force-login`
34
+ },
27
35
  {
28
36
  path: "callback",
29
37
  component: node
@@ -123,7 +131,7 @@ export function authRoutes(node, store, nested = 'auth') {
123
131
  export function configureRoutes(router) {
124
132
 
125
133
  router.beforeEach((to, from, next) => {
126
- const { authenticated, user, authBase, redirect, forcePasswordChange } = store.state.auth;
134
+ const { authenticated, user, authBase, redirect, forcePasswordChange, autoLogin } = store.state.auth;
127
135
 
128
136
  const admin = to.path.includes("/admin");
129
137
 
@@ -133,6 +141,9 @@ export function configureRoutes(router) {
133
141
  if (admin && !user?.admin) {
134
142
  next({ name: redirect });
135
143
  } else if (to.name === "login" || to.name === `${authBase}.login`) {
144
+ if(autoLogin) {
145
+ next({ name: `${authBase}.force-login` });
146
+ }
136
147
  next({ name: redirect });
137
148
  } else if (
138
149
  !user?.email_verified_at &&
@@ -9,7 +9,8 @@ const store = {
9
9
  forcePasswordChange: false,
10
10
  intended: null,
11
11
  user: null,
12
- redirect: process.env.HYDRATE_REDIRECT ?? 'index'
12
+ redirect: process.env.HYDRATE_REDIRECT ?? 'index',
13
+ autoLogin: process.env.HYDRATE_ADMIN ?? false,
13
14
  }
14
15
  },
15
16
 
@@ -0,0 +1,16 @@
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
+
10
+ <script>
11
+ export default {
12
+ mounted(){
13
+ window.location = '/login';
14
+ }
15
+ }
16
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-velocity",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Avalere Health branded style system",
5
5
  "scripts": {
6
6
  "setup": "npm ci || npm i && npm run content",