@hostlink/nuxt-light 1.19.0 → 1.19.1
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/dist/module.json +1 -1
- package/dist/runtime/components/L/System/Setting/authentication.vue +4 -1
- package/dist/runtime/components/l-app-main.vue +8 -7
- package/dist/runtime/components/l-app.vue +3 -2
- package/dist/runtime/components/l-login.vue +34 -20
- package/dist/runtime/components/l-microsoft-button.vue +2 -1
- package/dist/runtime/pages/User/setting/open_id.vue +3 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -8,6 +8,7 @@ export interface LSystemSettingAuthenticationProps {
|
|
|
8
8
|
authentication_google_client_id: string,
|
|
9
9
|
authentication_facebook_app_id: string,
|
|
10
10
|
authentication_microsoft_client_id: string,
|
|
11
|
+
authentication_microsoft_tenant_id: string
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
|
|
@@ -15,7 +16,8 @@ withDefaults(defineProps<LSystemSettingAuthenticationProps>(), {
|
|
|
15
16
|
authentication_password_based: "1",
|
|
16
17
|
authentication_google_client_id: "",
|
|
17
18
|
authentication_facebook_app_id: "",
|
|
18
|
-
authentication_microsoft_client_id: ""
|
|
19
|
+
authentication_microsoft_client_id: "",
|
|
20
|
+
authentication_microsoft_tenant_id: "",
|
|
19
21
|
})
|
|
20
22
|
|
|
21
23
|
const emits = defineEmits(["submit"])
|
|
@@ -50,5 +52,6 @@ const onSubmit = async (d: LSystemSettingAuthenticationProps) => {
|
|
|
50
52
|
<form-kit label="Facebook App ID" type="l-input" name="authentication_facebook_app_id" />
|
|
51
53
|
|
|
52
54
|
<form-kit label="Microsoft Client ID" type="l-input" name="authentication_microsoft_client_id" />
|
|
55
|
+
<form-kit label="Microsoft Tenant ID" type="l-input" name="authentication_microsoft_tenant_id" />
|
|
53
56
|
</form-kit>
|
|
54
57
|
</template>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
import { useRoute, useRouter } from 'vue-router';
|
|
3
3
|
import { useLight, q, m } from "#imports";
|
|
4
4
|
import { useQuasar } from 'quasar';
|
|
@@ -7,15 +7,12 @@ import { ref, computed, reactive, provide, watch, toRaw } from 'vue';
|
|
|
7
7
|
import { useRuntimeConfig } from 'nuxt/app';
|
|
8
8
|
import { api } from '#imports';
|
|
9
9
|
|
|
10
|
-
const { t } = useI18n();
|
|
11
|
-
|
|
12
10
|
const emits = defineEmits(["logout"]);
|
|
13
11
|
const $q = useQuasar();
|
|
14
12
|
$q.loading.show()
|
|
15
13
|
|
|
16
14
|
const config = useRuntimeConfig();
|
|
17
15
|
|
|
18
|
-
|
|
19
16
|
const appVersion = config.public.appVersion ?? '0.0.1';
|
|
20
17
|
|
|
21
18
|
const tt = await q({
|
|
@@ -113,10 +110,9 @@ if (my && my.roles.indexOf('Administrators') != -1) {
|
|
|
113
110
|
light.isAdmin = true;
|
|
114
111
|
}
|
|
115
112
|
|
|
116
|
-
const menuOverlayHeader = ref(false)
|
|
117
113
|
const layoutView = computed(() => {
|
|
118
114
|
let s = ''
|
|
119
|
-
s += menuOverlayHeader
|
|
115
|
+
s += style.menuOverlayHeader ? 'l' : 'h'
|
|
120
116
|
s += 'Hh LpR lFr'
|
|
121
117
|
return s
|
|
122
118
|
})
|
|
@@ -124,7 +120,8 @@ const layoutView = computed(() => {
|
|
|
124
120
|
const style = reactive({
|
|
125
121
|
miniState: my.styles?.miniState || false,
|
|
126
122
|
dense: my.styles?.dense || false,
|
|
127
|
-
footer: my.styles?.footer || false
|
|
123
|
+
footer: my.styles?.footer || false,
|
|
124
|
+
menuOverlayHeader: my.styles?.menuOverlayHeader || false
|
|
128
125
|
});
|
|
129
126
|
|
|
130
127
|
const isMouseOnDrawer = ref(false)
|
|
@@ -176,6 +173,10 @@ watch(() => light.theme, async () => {
|
|
|
176
173
|
$q.dark.set(light.isDarkMode());
|
|
177
174
|
})
|
|
178
175
|
|
|
176
|
+
watch(() => style.menuOverlayHeader, async (value) => {
|
|
177
|
+
await light.setStyle("menuOverlayHeader", value)
|
|
178
|
+
})
|
|
179
|
+
|
|
179
180
|
watch(() => style.miniState, async (value) => {
|
|
180
181
|
await m("updateMyStyle", {
|
|
181
182
|
name: "miniState",
|
|
@@ -23,9 +23,10 @@ try {
|
|
|
23
23
|
companyLogo: true,
|
|
24
24
|
logged: true,
|
|
25
25
|
twoFactorAuthentication: true,
|
|
26
|
-
googleClientId: true,
|
|
27
26
|
forgetPasswordEnabled: true,
|
|
27
|
+
googleClientId: true,
|
|
28
28
|
microsoftClientId: true,
|
|
29
|
+
microsoftTenantId: true,
|
|
29
30
|
passwordBasedEnabled: true,
|
|
30
31
|
facebookAppId: true,
|
|
31
32
|
}
|
|
@@ -78,7 +79,7 @@ if (app.value.facebookAppId) {
|
|
|
78
79
|
</q-page-container>
|
|
79
80
|
</q-layout>
|
|
80
81
|
|
|
81
|
-
<l-app-main v-else @logout="app.logged = false">
|
|
82
|
+
<l-app-main v-else @logout="app.logged = false" v-bind="app">
|
|
82
83
|
<template #header>
|
|
83
84
|
<slot name="header"></slot>
|
|
84
85
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, reactive, onMounted } from 'vue'
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, reactive, onMounted, resolveComponent } from 'vue'
|
|
3
3
|
import { useQuasar } from 'quasar';
|
|
4
|
-
import { api, useHead, m
|
|
4
|
+
import { api, useHead, m } from '#imports';
|
|
5
5
|
import { useI18n } from 'vue-i18n';
|
|
6
6
|
|
|
7
7
|
|
|
@@ -9,16 +9,19 @@ const { t } = useI18n();
|
|
|
9
9
|
|
|
10
10
|
const emits = defineEmits(["login"]);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
export interface LLoginProps {
|
|
13
|
+
company: string,
|
|
14
|
+
companyLogo: string,
|
|
15
|
+
twoFactorAuthentication: boolean,
|
|
16
|
+
forgetPasswordEnabled: boolean,
|
|
17
|
+
passwordBasedEnabled: boolean,
|
|
18
|
+
googleClientId?: string,
|
|
19
|
+
microsoftClientId?: string,
|
|
20
|
+
microsoftTenantId?: string,
|
|
21
|
+
facebookAppId?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = defineProps<LLoginProps>();
|
|
22
25
|
|
|
23
26
|
useHead({
|
|
24
27
|
title: props.company
|
|
@@ -31,11 +34,12 @@ const data = reactive({
|
|
|
31
34
|
|
|
32
35
|
const $q = useQuasar()
|
|
33
36
|
|
|
34
|
-
const loginWithCode = (username, password) => {
|
|
37
|
+
const loginWithCode = (username: string, password: string) => {
|
|
35
38
|
$q.dialog({
|
|
36
39
|
title: t("Enter your code"),
|
|
37
40
|
message: t("Please enter your two factor authentication code (If you lost your authenticator, please contact your administrator)"),
|
|
38
41
|
prompt: {
|
|
42
|
+
model: "",
|
|
39
43
|
type: "text",
|
|
40
44
|
required: true
|
|
41
45
|
},
|
|
@@ -85,7 +89,7 @@ const submit = async () => {
|
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
const resetPassword = (username, code) => {
|
|
92
|
+
const resetPassword = (username: string, code: string) => {
|
|
89
93
|
$q.dialog({
|
|
90
94
|
title: t("Reset password"),
|
|
91
95
|
message: t("Please enter your new password"),
|
|
@@ -127,6 +131,7 @@ const forgetPassword = async () => {
|
|
|
127
131
|
title: t("Enter your code"),
|
|
128
132
|
message: t("Please enter the code sent to your email, your code will expire in 10 minutes"),
|
|
129
133
|
prompt: {
|
|
134
|
+
model: "",
|
|
130
135
|
type: "text",
|
|
131
136
|
required: true
|
|
132
137
|
},
|
|
@@ -155,8 +160,12 @@ const bioLogin = async () => {
|
|
|
155
160
|
try {
|
|
156
161
|
await api.auth.WebAuthn.login(localStorage.getItem("username"));
|
|
157
162
|
window.self.location.reload();
|
|
158
|
-
} catch (e) {
|
|
159
|
-
notify(
|
|
163
|
+
} catch (e: any) {
|
|
164
|
+
$q.notify({
|
|
165
|
+
message: e.message,
|
|
166
|
+
color: "negative",
|
|
167
|
+
icon: "sym_o_error",
|
|
168
|
+
});
|
|
160
169
|
}
|
|
161
170
|
|
|
162
171
|
}
|
|
@@ -164,8 +173,12 @@ const handleGoogleCredentialResponse = async (response) => {
|
|
|
164
173
|
try {
|
|
165
174
|
await api.auth.googleLogin(response.credential);
|
|
166
175
|
window.self.location.reload();
|
|
167
|
-
} catch (e) {
|
|
168
|
-
notify(
|
|
176
|
+
} catch (e: any) {
|
|
177
|
+
$q.notify({
|
|
178
|
+
message: e.message,
|
|
179
|
+
color: "negative",
|
|
180
|
+
icon: "sym_o_error",
|
|
181
|
+
});
|
|
169
182
|
}
|
|
170
183
|
}
|
|
171
184
|
|
|
@@ -282,7 +295,8 @@ const facebookLogin = (accessToken) => {
|
|
|
282
295
|
</q-card-actions>
|
|
283
296
|
|
|
284
297
|
<q-card-actions v-if="microsoftClientId">
|
|
285
|
-
<l-microsoft-button :client-id="microsoftClientId"
|
|
298
|
+
<l-microsoft-button :client-id="microsoftClientId" :tenant-id="microsoftTenantId"
|
|
299
|
+
@login="microsoftLogin"></l-microsoft-button>
|
|
286
300
|
</q-card-actions>
|
|
287
301
|
|
|
288
302
|
<q-card-actions v-if="facebookAppId">
|
|
@@ -8,6 +8,7 @@ const props = defineProps({
|
|
|
8
8
|
type: String,
|
|
9
9
|
required: true
|
|
10
10
|
},
|
|
11
|
+
tenantId: String
|
|
11
12
|
})
|
|
12
13
|
|
|
13
14
|
const emits = defineEmits(["login"]);
|
|
@@ -16,7 +17,7 @@ const onClick = async () => {
|
|
|
16
17
|
const myMSALObject = new PublicClientApplication({
|
|
17
18
|
auth: {
|
|
18
19
|
clientId: props.clientId,
|
|
19
|
-
authority: "https://login.microsoftonline.com/
|
|
20
|
+
authority: "https://login.microsoftonline.com/" + props.tenantId,
|
|
20
21
|
redirectUri: window.location.origin,
|
|
21
22
|
},
|
|
22
23
|
cache: {
|
|
@@ -11,6 +11,7 @@ let { app, my } = await q({
|
|
|
11
11
|
app: {
|
|
12
12
|
googleClientId: true,
|
|
13
13
|
microsoftClientId: true,
|
|
14
|
+
microsoftTenantId: true,
|
|
14
15
|
facebookAppId: true,
|
|
15
16
|
}, my: {
|
|
16
17
|
google: true,
|
|
@@ -201,7 +202,8 @@ const onUnlinkFacebook = async () => {
|
|
|
201
202
|
<template v-else>
|
|
202
203
|
<div>{{ $t('Click the button below to link your Microsoft account.') }}</div>
|
|
203
204
|
<div>
|
|
204
|
-
<l-microsoft-button :client-id="app.microsoftClientId"
|
|
205
|
+
<l-microsoft-button :client-id="app.microsoftClientId" :tenant-id="app.microsoftTenantId"
|
|
206
|
+
@login="onLinkMicrosoft" />
|
|
205
207
|
</div>
|
|
206
208
|
</template>
|
|
207
209
|
</template>
|