@sowell/quasar-app-extension-auth 0.5.1 → 1.0.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.
- package/.eslintrc.js +7 -3
- package/.prettierrc +9 -0
- package/package.json +5 -6
- package/src/components/dialogs/Message.vue +21 -19
- package/src/components/dialogs/SendEmail.vue +26 -22
- package/src/components/dialogs/WebSendEmail.vue +18 -15
- package/src/components/dialogs/sw-info-dialog.vue +9 -6
- package/src/components/pages/AdminAuth.vue +41 -45
- package/src/components/pages/Auth.vue +63 -73
- package/src/components/pages/AuthReporter.vue +41 -35
- package/src/components/pages/OtpValidation.vue +45 -40
- package/src/components/pages/ResetPassword.vue +12 -10
- package/src/components/pages/WebAuth.vue +48 -50
- package/src/components/pages/WebResetPassword.vue +24 -36
- package/src/composables/auth.ts +94 -89
- package/src/composables/resetPassword.ts +91 -91
- package/src/index.js +20 -20
- package/src/injects/api.ts +5 -5
- package/src/injects/index.ts +4 -4
- package/src/injects/prompts.ts +24 -24
- package/src/injects/router.ts +6 -6
- package/src/injects/states.ts +60 -60
- package/src/interfaces/Boot.ts +4 -4
- package/src/interfaces/index.ts +2 -2
- package/src/routes/index.ts +28 -22
- package/src/shims-vue.d.ts +4 -4
- package/tsconfig.json +10 -7
package/src/routes/index.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1
2
|
//@ts-ignore
|
|
2
|
-
import prompts from "app/quasar.extensions.json"
|
|
3
|
-
|
|
3
|
+
import prompts from "app/quasar.extensions.json"
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
5
|
+
//@ts-ignore
|
|
6
|
+
import { RouteRecordRaw } from "vue-router"
|
|
4
7
|
|
|
5
8
|
const {
|
|
6
9
|
"@sowell/auth": {
|
|
@@ -8,29 +11,29 @@ const {
|
|
|
8
11
|
LOCAL_UPDATE_PASSWORD_ROUTE,
|
|
9
12
|
X_REQUESTED_ROLES,
|
|
10
13
|
UI_PAGE,
|
|
11
|
-
LOCAL_OTP_ROUTE
|
|
12
|
-
}
|
|
13
|
-
} = prompts
|
|
14
|
+
LOCAL_OTP_ROUTE
|
|
15
|
+
}
|
|
16
|
+
} = prompts
|
|
14
17
|
|
|
15
18
|
// FIXME: Utiliser le UI_PAGE pour choisir les page a utiliser pour la version web ou mobile (auth et reset password)
|
|
16
|
-
const webAuthRoles = ["superadmin", "clean_manager", "manager"]
|
|
17
|
-
const AdminAuthRoles = ["admin"]
|
|
19
|
+
const webAuthRoles = ["superadmin", "clean_manager", "manager"]
|
|
20
|
+
const AdminAuthRoles = ["admin"]
|
|
18
21
|
|
|
19
|
-
let authPage = ""
|
|
22
|
+
let authPage = ""
|
|
20
23
|
|
|
21
24
|
switch (UI_PAGE) {
|
|
22
25
|
case "mobile_clean":
|
|
23
|
-
authPage = "Auth.vue"
|
|
24
|
-
break
|
|
26
|
+
authPage = "Auth.vue"
|
|
27
|
+
break
|
|
25
28
|
case "reporter":
|
|
26
|
-
authPage = "AuthReporter.vue"
|
|
27
|
-
break
|
|
29
|
+
authPage = "AuthReporter.vue"
|
|
30
|
+
break
|
|
28
31
|
case "admin":
|
|
29
|
-
authPage = "AdminAuth.vue"
|
|
30
|
-
break
|
|
32
|
+
authPage = "AdminAuth.vue"
|
|
33
|
+
break
|
|
31
34
|
default:
|
|
32
|
-
authPage = "Auth.vue"
|
|
33
|
-
break
|
|
35
|
+
authPage = "Auth.vue"
|
|
36
|
+
break
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
const loginPage = (X_REQUESTED_ROLES: string): string => {
|
|
@@ -38,20 +41,21 @@ const loginPage = (X_REQUESTED_ROLES: string): string => {
|
|
|
38
41
|
? "AdminAuth.vue"
|
|
39
42
|
: webAuthRoles.includes(X_REQUESTED_ROLES)
|
|
40
43
|
? "WebAuth.vue"
|
|
41
|
-
: authPage
|
|
42
|
-
}
|
|
44
|
+
: authPage
|
|
45
|
+
}
|
|
43
46
|
|
|
44
47
|
const isInRoles = (X_REQUESTED_ROLES: string): string => {
|
|
45
48
|
return webAuthRoles.includes(X_REQUESTED_ROLES) ||
|
|
46
49
|
AdminAuthRoles.includes(X_REQUESTED_ROLES)
|
|
47
50
|
? "WebResetPassword.vue"
|
|
48
|
-
: "ResetPassword.vue"
|
|
49
|
-
}
|
|
51
|
+
: "ResetPassword.vue"
|
|
52
|
+
}
|
|
50
53
|
|
|
51
54
|
const routes: RouteRecordRaw[] = [
|
|
52
55
|
{
|
|
53
56
|
path: LOCAL_LOGIN_ROUTE,
|
|
54
57
|
component: () =>
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
55
59
|
// @ts-ignore
|
|
56
60
|
import(`@sowell/auth/pages/${loginPage(X_REQUESTED_ROLES)}`),
|
|
57
61
|
},
|
|
@@ -59,6 +63,7 @@ const routes: RouteRecordRaw[] = [
|
|
|
59
63
|
path: LOCAL_UPDATE_PASSWORD_ROUTE,
|
|
60
64
|
name: "update_password",
|
|
61
65
|
component: () =>
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
62
67
|
// @ts-ignore
|
|
63
68
|
import(`@sowell/auth/pages/${isInRoles(X_REQUESTED_ROLES)}`),
|
|
64
69
|
},
|
|
@@ -66,9 +71,10 @@ const routes: RouteRecordRaw[] = [
|
|
|
66
71
|
path: LOCAL_OTP_ROUTE,
|
|
67
72
|
name: "otp_validation",
|
|
68
73
|
component: () =>
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
69
75
|
// @ts-ignore
|
|
70
76
|
import("@sowell/auth/pages/OtpValidation.vue"),
|
|
71
77
|
},
|
|
72
|
-
]
|
|
78
|
+
]
|
|
73
79
|
|
|
74
|
-
export default routes
|
|
80
|
+
export default routes
|
package/src/shims-vue.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Mocks all files ending in `.vue` showing them as plain Vue instances
|
|
2
|
-
declare module
|
|
3
|
-
import { ComponentOptions } from
|
|
4
|
-
const component: ComponentOptions
|
|
5
|
-
export default component
|
|
2
|
+
declare module "*.vue" {
|
|
3
|
+
import { ComponentOptions } from "vue"
|
|
4
|
+
const component: ComponentOptions
|
|
5
|
+
export default component
|
|
6
6
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"allowJs": true,
|
|
4
|
-
"target": "
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"lib": [
|
|
6
|
+
"ES2020",
|
|
7
|
+
"DOM"
|
|
8
|
+
],
|
|
9
|
+
"jsx": "preserve",
|
|
5
10
|
"strict": true,
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
11
|
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
+
"types": [
|
|
13
|
+
"node"
|
|
14
|
+
]
|
|
12
15
|
}
|
|
13
|
-
}
|
|
16
|
+
}
|