@live-change/user-frontend 0.8.13 → 0.8.15

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.
@@ -3,20 +3,25 @@ export function routes(config = {}) {
3
3
 
4
4
  return [
5
5
 
6
- route({ name: 'user:signIn', path: prefix + 'sign-in',
7
- component: () => import("./SignIn.vue") }),
6
+ route({ name: 'user:googleAuth', path: prefix + 'google-auth/:action',
7
+ component: () => import("./GoogleAuth.vue"), props: true, meta: { signedOut: true } }),
8
+ route({ name: 'user:googleAuthReturn', path: prefix + 'google-auth-return/:action',
9
+ component: () => import("./GoogleAuthReturn.vue"), props: true }),
10
+
11
+ route({ name: 'user:signInEmail', path: prefix + 'sign-in-email',
12
+ component: () => import("./SignInEmail.vue"), meta: { signedOut: true } }),
8
13
  route({ name: 'user:signInFinished', path: prefix + 'sign-in-finished',
9
14
  component: () => import("./SignInFinished.vue"), meta: { signedIn: true } }),
10
15
 
11
- route({ name: 'user:signUp', path: prefix + 'sign-up',
12
- component: () => import("./SignUp.vue") }),
16
+ route({ name: 'user:signUpEmail', path: prefix + 'sign-up-email',
17
+ component: () => import("./SignUpEmail.vue"), meta: { signedOut: true } }),
13
18
  route({ name: 'user:signUpFinished', path: prefix + 'sign-up-finished',
14
19
  component: () => import("./SignUpFinished.vue"), meta: { signedIn: true } }),
15
20
 
16
21
  route({ name: 'user:signOut', path: prefix + 'sign-out',
17
22
  component: () => import("./SignOut.vue") }),
18
23
  route({ name: 'user:signOutFinished', path: prefix + 'sign-out-finished',
19
- component: () => import("./SignOutFinished.vue") }),
24
+ component: () => import("./SignOutFinished.vue"), meta: { signedOut: true } }),
20
25
 
21
26
  ]
22
27
  }
@@ -0,0 +1,50 @@
1
+ let googPromise
2
+
3
+ function loadGoogle() {
4
+ if(googPromise) return googPromise
5
+ let resolved = false
6
+ googPromise = new Promise((resolve, reject) => {
7
+ if (typeof window != 'undefined') {
8
+ window.googAsyncInit = function () {
9
+ if(resolved) return
10
+ resolved = true
11
+ resolve(gapi)
12
+ }
13
+
14
+ ;(function (d, s, id) {
15
+ const fjs = d.getElementsByTagName(s)[0]
16
+ if (d.getElementById(id)) return
17
+ const js = d.createElement(s)
18
+ js.id = id
19
+ js.src = "https://apis.google.com/js/platform.js?onload=googAsyncInit"
20
+ fjs.parentNode.insertBefore(js, fjs)
21
+ }(document, 'script', 'google-jssdk'))
22
+ } else {
23
+ reject('unavailable')
24
+ }
25
+ })
26
+ return googPromise
27
+ }
28
+
29
+ let googAuth2Promise
30
+
31
+ async function loadGoogleAuth2() {
32
+ if(googAuth2Promise) return googAuth2Promise
33
+ let gapi = await loadGoogle()
34
+ let resolved = false
35
+ googAuth2Promise = new Promise((resolve, reject) => {
36
+ gapi.load('auth2', function() {
37
+ if(resolved) return
38
+ resolved = true
39
+ let client_id = ENV_GOOGLE_CLIENT_ID
40
+ resolve(gapi.auth2.init({
41
+ client_id
42
+ }))
43
+ })
44
+ })
45
+ return googAuth2Promise
46
+ }
47
+
48
+
49
+
50
+ export { loadGoogle, loadGoogleAuth2 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/user-frontend",
3
- "version": "0.8.13",
3
+ "version": "0.8.15",
4
4
  "scripts": {
5
5
  "memDev": "node --inspect --expose-gc server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; node server/start.js localDev --enableSessions --initScript ./init.js",
@@ -17,33 +17,34 @@
17
17
  "build:client": "cd front; vite build --ssrManifest --outDir dist/client",
18
18
  "build:server": "cd front; vite build --ssr src/entry-server.js --outDir dist/server",
19
19
  "generate": "vite build --ssrManifest --outDir dist/static && yarn build:server && node prerender",
20
- "debug": "node --inspect-brk server"
20
+ "debug": "node --inspect-brk server",
21
+ "describe": "node server/start.js describe"
21
22
  },
22
23
  "type": "module",
23
24
  "dependencies": {
24
- "@live-change/cli": "^0.8.13",
25
- "@live-change/dao": "^0.8.13",
26
- "@live-change/dao-vue3": "^0.8.13",
27
- "@live-change/dao-websocket": "^0.8.13",
28
- "@live-change/email-service": "^0.8.13",
29
- "@live-change/framework": "^0.8.13",
30
- "@live-change/identicon-service": "^0.8.13",
31
- "@live-change/image-frontend": "^0.8.13",
32
- "@live-change/message-authentication-service": "^0.8.13",
33
- "@live-change/notification-service": "^0.8.13",
34
- "@live-change/password-authentication-service": "^0.8.13",
35
- "@live-change/pattern": "^0.8.13",
36
- "@live-change/secret-code-service": "^0.8.13",
37
- "@live-change/secret-link-service": "^0.8.13",
38
- "@live-change/security-frontend": "^0.8.13",
39
- "@live-change/security-service": "^0.8.13",
40
- "@live-change/session-service": "^0.8.13",
41
- "@live-change/timer-service": "^0.8.13",
42
- "@live-change/upload-service": "^0.8.13",
43
- "@live-change/user-identification-service": "^0.8.13",
44
- "@live-change/user-service": "^0.8.13",
45
- "@live-change/vue3-components": "^0.8.13",
46
- "@live-change/vue3-ssr": "^0.8.13",
25
+ "@live-change/cli": "^0.8.15",
26
+ "@live-change/dao": "^0.8.15",
27
+ "@live-change/dao-vue3": "^0.8.15",
28
+ "@live-change/dao-websocket": "^0.8.15",
29
+ "@live-change/email-service": "^0.8.15",
30
+ "@live-change/framework": "^0.8.15",
31
+ "@live-change/identicon-service": "^0.8.15",
32
+ "@live-change/image-frontend": "^0.8.15",
33
+ "@live-change/message-authentication-service": "^0.8.15",
34
+ "@live-change/notification-service": "^0.8.15",
35
+ "@live-change/password-authentication-service": "^0.8.15",
36
+ "@live-change/pattern": "^0.8.15",
37
+ "@live-change/secret-code-service": "^0.8.15",
38
+ "@live-change/secret-link-service": "^0.8.15",
39
+ "@live-change/security-frontend": "^0.8.15",
40
+ "@live-change/security-service": "^0.8.15",
41
+ "@live-change/session-service": "^0.8.15",
42
+ "@live-change/timer-service": "^0.8.15",
43
+ "@live-change/upload-service": "^0.8.15",
44
+ "@live-change/user-identification-service": "^0.8.15",
45
+ "@live-change/user-service": "^0.8.15",
46
+ "@live-change/vue3-components": "^0.8.15",
47
+ "@live-change/vue3-ssr": "^0.8.15",
47
48
  "@vueuse/core": "^10.7.2",
48
49
  "codeceptjs-assert": "^0.0.5",
49
50
  "codeceptjs-video-helper": "0.1.3",
@@ -64,7 +65,7 @@
64
65
  "wtfnode": "^0.9.1"
65
66
  },
66
67
  "devDependencies": {
67
- "@live-change/codeceptjs-helper": "^0.8.13",
68
+ "@live-change/codeceptjs-helper": "^0.8.15",
68
69
  "codeceptjs": "^3.5.12",
69
70
  "generate-password": "1.7.1",
70
71
  "playwright": "^1.41.2",
@@ -75,5 +76,5 @@
75
76
  "author": "",
76
77
  "license": "BSD-3-Clause",
77
78
  "description": "",
78
- "gitHead": "4453aa639a9fe1a857d93d73ebd28a82c97fdd87"
79
+ "gitHead": "4897eefbf3ce9ace57630127da89503c71114563"
79
80
  }
@@ -2,6 +2,7 @@ import App from "@live-change/framework"
2
2
  const app = App.app()
3
3
 
4
4
  const contactTypes = ['email', 'phone']
5
+ const remoteAccountTypes = ['google']
5
6
 
6
7
  import securityConfig from './security.config.js'
7
8
 
@@ -18,7 +19,8 @@ app.config = {
18
19
  },
19
20
  {
20
21
  name: 'user',
21
- path: '@live-change/user-service'
22
+ path: '@live-change/user-service',
23
+ remoteAccountTypes
22
24
  },
23
25
  {
24
26
  name: 'email',
@@ -50,6 +52,10 @@ app.config = {
50
52
  contactTypes,
51
53
  signInWithoutPassword: true
52
54
  },
55
+ {
56
+ name: 'googleAuthentication',
57
+ path: '@live-change/google-authentication-service',
58
+ },
53
59
  {
54
60
  name: 'security',
55
61
  path: '@live-change/security-service',
@@ -13,6 +13,7 @@ import image from '@live-change/image-service'
13
13
  import secretCode from '@live-change/secret-code-service'
14
14
  import secretLink from '@live-change/secret-link-service'
15
15
  import messageAuthentication from '@live-change/message-authentication-service'
16
+ import googleAuthentication from '@live-change/google-authentication-service'
16
17
 
17
18
  import backup from '@live-change/backup-service'
18
19
  import init from './init.js'
@@ -32,6 +33,7 @@ export {
32
33
  secretCode,
33
34
  secretLink,
34
35
  messageAuthentication,
36
+ googleAuthentication,
35
37
  localeSettings,
36
38
  backup,
37
39
  init
package/server/start.js CHANGED
@@ -10,7 +10,7 @@ import { starter } from '@live-change/cli'
10
10
 
11
11
  starter(appConfig)
12
12
 
13
- /*
13
+ //*
14
14
  import os from 'os'
15
15
  const formatMemoryUsage = (data) => `${Math.round(data / 1024 / 1024 * 100) / 100} MB`;
16
16
  const formatUptime = (data) => // dd:hh:mm:ss