@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 &&
|