@hostlink/nuxt-light 0.0.73 → 0.0.74
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/README.md +18 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.d.ts +3 -3
- package/dist/module.json +1 -1
- package/dist/runtime/components/l-app.vue +16 -3
- package/dist/runtime/components/l-login.vue +43 -1
- package/dist/types.d.mts +15 -0
- package/package.json +7 -8
package/README.md
CHANGED
|
@@ -104,3 +104,21 @@ npm run release
|
|
|
104
104
|
</l-app>
|
|
105
105
|
</template>
|
|
106
106
|
```
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Google Sigin
|
|
111
|
+
nuxt.config.ts
|
|
112
|
+
```js
|
|
113
|
+
app: {
|
|
114
|
+
head: {
|
|
115
|
+
script: [
|
|
116
|
+
{
|
|
117
|
+
src: 'https://accounts.google.com/gsi/client',
|
|
118
|
+
async: true,
|
|
119
|
+
defer: true,
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
package/dist/module.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
|
-
interface ModuleOptions {
|
|
4
|
-
}
|
|
3
|
+
interface ModuleOptions {
|
|
4
|
+
}
|
|
5
5
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
6
6
|
|
|
7
|
-
export { ModuleOptions, _default as default };
|
|
7
|
+
export { type ModuleOptions, _default as default };
|
package/dist/module.json
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useRuntimeConfig } from 'nuxt/app'
|
|
3
3
|
import { setApiUrl } from '@hostlink/light'
|
|
4
|
-
import {
|
|
4
|
+
import { Dialog } from 'quasar'
|
|
5
5
|
import { q } from '../'
|
|
6
|
-
const route = useRoute()
|
|
7
6
|
const config = useRuntimeConfig();
|
|
8
7
|
setApiUrl(config?.public?.apiBase ?? '/api/');
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
let app = null
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
app = (await q({ app: ['company', 'companyLogo', 'logged', 'twoFactorAuthentication'] })).app;
|
|
14
|
+
} catch (e) {
|
|
15
|
+
Dialog.create({
|
|
16
|
+
title: 'Error',
|
|
17
|
+
message: 'Error loading api data. Please reload the page.',
|
|
18
|
+
ok: 'Reload',
|
|
19
|
+
}).onOk(() => {
|
|
20
|
+
window.location.reload();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
12
25
|
</script>
|
|
13
26
|
<template>
|
|
14
27
|
<q-layout v-if="!app.logged">
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, reactive } from 'vue'
|
|
2
|
+
import { ref, reactive, onMounted } from 'vue'
|
|
3
3
|
import { useQuasar } from 'quasar';
|
|
4
4
|
import { useI18n } from 'vue-i18n';
|
|
5
5
|
import { m, notify } from '../';
|
|
6
6
|
|
|
7
|
+
import { useRuntimeConfig } from 'nuxt/app';
|
|
8
|
+
|
|
7
9
|
import { login, webauthnLogin } from '@hostlink/light';
|
|
8
10
|
|
|
11
|
+
const config = useRuntimeConfig();
|
|
12
|
+
|
|
9
13
|
|
|
10
14
|
defineProps({
|
|
11
15
|
company: String,
|
|
@@ -119,6 +123,36 @@ const bioLogin = async () => {
|
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
}
|
|
126
|
+
const googleResponse = () => {
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
onMounted(() => {
|
|
131
|
+
if (config.public.GOOGLE_CLIENT_ID) {
|
|
132
|
+
//google
|
|
133
|
+
google.accounts.id.initialize({
|
|
134
|
+
client_id: "829616239009-23sf7s3blsnab9a288sb4j15orqqamlp.apps.googleusercontent.com",
|
|
135
|
+
callback: googleResponse,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
google.accounts.id.renderButton(
|
|
139
|
+
document.getElementById('g_id_signin'),
|
|
140
|
+
{
|
|
141
|
+
type: 'profile',
|
|
142
|
+
shape: 'pill',
|
|
143
|
+
theme: 'outline',
|
|
144
|
+
text: 'signin_with',
|
|
145
|
+
size: 'large',
|
|
146
|
+
logo_alignment: 'left'
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
|
|
122
156
|
|
|
123
157
|
</script>
|
|
124
158
|
|
|
@@ -145,5 +179,13 @@ const bioLogin = async () => {
|
|
|
145
179
|
<l-btn v-if="hasBioLogin" outline rounded color="primary" icon="sym_o_fingerprint" @click="bioLogin" />
|
|
146
180
|
<l-btn label="Forget password" outline rounded color="primary" icon="sym_o_lock_reset" @click="forgetPassword" />
|
|
147
181
|
</q-card-actions>
|
|
182
|
+
<q-card-actions v-if="config.public.GOOGLE_CLIENT_ID">
|
|
183
|
+
|
|
184
|
+
<div>
|
|
185
|
+
|
|
186
|
+
<div id="g_id_signin"></div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
</q-card-actions>
|
|
148
190
|
</q-card>
|
|
149
191
|
</template>
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModuleOptions } from './module'
|
|
3
|
+
|
|
4
|
+
declare module '@nuxt/schema' {
|
|
5
|
+
interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
|
|
6
|
+
interface NuxtOptions { ['light']?: ModuleOptions }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module 'nuxt/schema' {
|
|
10
|
+
interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
|
|
11
|
+
interface NuxtOptions { ['light']?: ModuleOptions }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export { ModuleOptions, default } from './module'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.74",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": "@hostlink/nuxt-light",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"prepack": "nuxt-module-build",
|
|
25
|
+
"prepack": "nuxt-module-build build",
|
|
26
26
|
"dev": "nuxi dev playground",
|
|
27
27
|
"dev:build": "nuxi build playground",
|
|
28
|
-
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
|
|
28
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground",
|
|
29
29
|
"release:org": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
30
30
|
"release": "npm run prepack && changelogen --release && npm publish --access=public && git push --follow-tags",
|
|
31
31
|
"lint": "eslint .",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@hostlink/light": "^0.0.24",
|
|
38
|
-
"@nuxt/kit": "^3.7.
|
|
38
|
+
"@nuxt/kit": "^3.7.4",
|
|
39
|
+
"@nuxt/module-builder": "^0.5.2",
|
|
39
40
|
"@quasar/extras": "^1.16.6",
|
|
40
41
|
"axios": "^1.5.0",
|
|
41
|
-
"gql-query-builder": "^3.8.0",
|
|
42
42
|
"json-to-graphql-query": "^2.2.5",
|
|
43
43
|
"quasar": "^2.12.5",
|
|
44
44
|
"unplugin-auto-import": "^0.16.6",
|
|
@@ -48,9 +48,8 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@nuxt/content": "^2.8.2",
|
|
50
50
|
"@nuxt/devtools": "latest",
|
|
51
|
-
"@nuxt/eslint-config": "^0.
|
|
52
|
-
"@nuxt/
|
|
53
|
-
"@nuxt/schema": "^3.7.0",
|
|
51
|
+
"@nuxt/eslint-config": "^0.2.0",
|
|
52
|
+
"@nuxt/schema": "^3.7.4",
|
|
54
53
|
"@nuxt/test-utils": "^3.7.0",
|
|
55
54
|
"@types/node": "^18.17.3",
|
|
56
55
|
"changelogen": "^0.5.4",
|