@live-change/user-frontend 0.9.175 → 0.9.177
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/front/src/message-auth/email/ConnectEmail.vue +1 -2
- package/front/src/message-auth/email/ResetPasswordEmail.vue +1 -2
- package/front/src/message-auth/email/SignInEmail.vue +2 -3
- package/front/src/message-auth/sms/ConnectSms.vue +1 -2
- package/front/src/message-auth/sms/ResetPasswordSms.vue +1 -2
- package/front/src/message-auth/sms/SignInSms.vue +1 -2
- package/front/src/sign/GoogleAuthReturn.vue +38 -26
- package/front/src/sign/SignInFinished.vue +6 -0
- package/front/src/sign/SignUpFinished.vue +5 -0
- package/package.json +26 -26
|
@@ -72,10 +72,9 @@
|
|
|
72
72
|
const secretLink = secrets.find(secret => secret.type === 'link')
|
|
73
73
|
const secretCode = secrets.find(secret => secret.type === 'code')
|
|
74
74
|
|
|
75
|
-
const owner = { sessionOrUserType: 'user_User', sessionOrUser: data.user }
|
|
76
75
|
import { useLocale } from "@live-change/vue3-components"
|
|
77
76
|
const locale = useLocale()
|
|
78
|
-
const localePromise = locale.
|
|
77
|
+
const localePromise = locale.getOtherUserOrSessionLocale(data.user, data.client?.session)
|
|
79
78
|
await Promise.all([localePromise])
|
|
80
79
|
import { useI18n } from 'vue-i18n'
|
|
81
80
|
const { locale: i18nLocale, t } = useI18n()
|
|
@@ -72,10 +72,9 @@
|
|
|
72
72
|
const secretLink = secrets.find(secret => secret.type === 'link')
|
|
73
73
|
const secretCode = secrets.find(secret => secret.type === 'code')
|
|
74
74
|
|
|
75
|
-
const owner = { sessionOrUserType: 'user_User', sessionOrUser: data.user }
|
|
76
75
|
import { useLocale } from "@live-change/vue3-components"
|
|
77
76
|
const locale = useLocale()
|
|
78
|
-
const localePromise = locale.
|
|
77
|
+
const localePromise = locale.getOtherUserOrSessionLocale(data.user, data.client?.session)
|
|
79
78
|
await Promise.all([localePromise])
|
|
80
79
|
import { useI18n } from 'vue-i18n'
|
|
81
80
|
const { locale: i18nLocale, t } = useI18n()
|
|
@@ -71,11 +71,10 @@
|
|
|
71
71
|
|
|
72
72
|
const secretLink = secrets.find(secret => secret.type === 'link')
|
|
73
73
|
const secretCode = secrets.find(secret => secret.type === 'code')
|
|
74
|
-
|
|
75
|
-
const owner = { sessionOrUserType: 'user_User', sessionOrUser: data.user }
|
|
74
|
+
|
|
76
75
|
import { useLocale } from "@live-change/vue3-components"
|
|
77
76
|
const locale = useLocale()
|
|
78
|
-
const localePromise = locale.
|
|
77
|
+
const localePromise = locale.getOtherUserOrSessionLocale(data.user, data.client?.session)
|
|
79
78
|
await Promise.all([localePromise])
|
|
80
79
|
import { useI18n } from 'vue-i18n'
|
|
81
80
|
const { locale: i18nLocale, t } = useI18n()
|
|
@@ -32,10 +32,9 @@
|
|
|
32
32
|
const secretLink = secrets.find(secret => secret.type === 'link')
|
|
33
33
|
const secretCode = secrets.find(secret => secret.type === 'code')
|
|
34
34
|
|
|
35
|
-
const owner = { sessionOrUserType: 'user_User', sessionOrUser: data.user }
|
|
36
35
|
import { useLocale } from "@live-change/vue3-components"
|
|
37
36
|
const locale = useLocale()
|
|
38
|
-
const localePromise = locale.
|
|
37
|
+
const localePromise = locale.getOtherUserOrSessionLocale(data.user, data.client?.session)
|
|
39
38
|
await Promise.all([localePromise])
|
|
40
39
|
import { useI18n } from 'vue-i18n'
|
|
41
40
|
const { locale: i18nLocale, t } = useI18n()
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
const secretLink = secrets.find(secret => secret.type === 'link')
|
|
31
31
|
const secretCode = secrets.find(secret => secret.type === 'code')
|
|
32
32
|
|
|
33
|
-
const owner = { sessionOrUserType: 'user_User', sessionOrUser: data.user }
|
|
34
33
|
import { useLocale } from "@live-change/vue3-components"
|
|
35
34
|
const locale = useLocale()
|
|
36
|
-
const localePromise = locale.
|
|
35
|
+
const localePromise = locale.getOtherUserOrSessionLocale(data.user, data.client?.session)
|
|
37
36
|
await Promise.all([localePromise])
|
|
38
37
|
import { useI18n } from 'vue-i18n'
|
|
39
38
|
const { locale: i18nLocale, t } = useI18n()
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
const secretLink = secrets.find(secret => secret.type === 'link')
|
|
31
31
|
const secretCode = secrets.find(secret => secret.type === 'code')
|
|
32
32
|
|
|
33
|
-
const owner = { sessionOrUserType: 'user_User', sessionOrUser: data.user }
|
|
34
33
|
import { useLocale } from "@live-change/vue3-components"
|
|
35
34
|
const locale = useLocale()
|
|
36
|
-
const localePromise = locale.
|
|
35
|
+
const localePromise = locale.getOtherUserOrSessionLocale(data.user, data.client?.session)
|
|
37
36
|
await Promise.all([localePromise])
|
|
38
37
|
import { useI18n } from 'vue-i18n'
|
|
39
38
|
const { locale: i18nLocale, t } = useI18n()
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
<div>Error during authentication</div>
|
|
21
21
|
<div>{{ error }}</div>
|
|
22
22
|
</div>
|
|
23
|
+
<div v-else-if="state === 'emailTaken'" class="text-center">
|
|
24
|
+
<div>
|
|
25
|
+
Your account was created using email address. If you want to connect your Google account,
|
|
26
|
+
you need to sign in with this email address. And connect your Google account using
|
|
27
|
+
<router-link :to="{ name: 'user:connected' }">connected accounts page</router-link>.
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
23
30
|
<div v-else>
|
|
24
31
|
Unknown authentication state: {{ state }}
|
|
25
32
|
</div>
|
|
@@ -62,36 +69,41 @@
|
|
|
62
69
|
state.value = 'canceled'
|
|
63
70
|
return
|
|
64
71
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
api.command(['googleAuthentication', action.value], {
|
|
72
|
+
await workingZone.addPromise(`google ${action.value}`, (async () => {
|
|
73
|
+
try {
|
|
74
|
+
const result = await api.command(['googleAuthentication', action.value], {
|
|
68
75
|
redirectUri: document.location.protocol + '//' + document.location.host
|
|
69
76
|
+ router.resolve({ name: 'user:googleAuthReturn', params: { action: action.value } }).href,
|
|
70
77
|
...query
|
|
71
78
|
})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
79
|
+
console.log("GAUTH RESULT", result)
|
|
80
|
+
const { action: actionDone, user } = result
|
|
81
|
+
while(user && api.client.value.user !== user) {
|
|
82
|
+
await new Promise(resolve => setTimeout(resolve, 100))
|
|
83
|
+
}
|
|
84
|
+
if(actionDone === 'signIn') {
|
|
85
|
+
router.push({ name: 'user:signInFinished' })
|
|
86
|
+
} else if(actionDone === 'signUp') {
|
|
87
|
+
router.push({ name: 'user:signUpFinished' })
|
|
88
|
+
} else if(actionDone === 'connectGoogle') {
|
|
89
|
+
router.push({ name: 'user:connected' })
|
|
90
|
+
} else if(actionDone === 'addOfflineAccessToken') {
|
|
91
|
+
router.push({ name: 'user:google-access-gained' })
|
|
92
|
+
} else {
|
|
93
|
+
console.error("Unknown action", actionDone)
|
|
94
|
+
}
|
|
95
|
+
} catch(err) {
|
|
96
|
+
if(err?.properties?.email == 'emailTaken') {
|
|
97
|
+
toast.add({ severity: 'error', summary: 'Error', detail: 'Email is already in use', life: 3000 })
|
|
98
|
+
state.value = 'emailTaken'
|
|
99
|
+
return
|
|
100
|
+
}
|
|
101
|
+
console.error("Google auth error", err)
|
|
102
|
+
toast.add({ severity: 'error', summary: 'Error', detail: 'Error during google authentication', life: 3000 })
|
|
103
|
+
state.value = 'error'
|
|
104
|
+
error.value = err
|
|
105
|
+
}
|
|
106
|
+
})())
|
|
95
107
|
})
|
|
96
108
|
|
|
97
109
|
async function back() {
|
|
@@ -72,6 +72,10 @@
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
import { useLocale } from '@live-change/vue3-components'
|
|
77
|
+
const locale = useLocale()
|
|
78
|
+
|
|
75
79
|
let finished = false
|
|
76
80
|
onMounted(async () => {
|
|
77
81
|
console.log("WAIT FOR USER?", !finished, !api.client.value.user, !finished && !api.client.value.user)
|
|
@@ -79,6 +83,8 @@
|
|
|
79
83
|
console.log("WAITING FOR USER...")
|
|
80
84
|
await new Promise(resolve => setTimeout(resolve, 200))
|
|
81
85
|
}
|
|
86
|
+
console.log("CAPTURE LOCALE", api.client.value.user)
|
|
87
|
+
locale.captureLocale(true)
|
|
82
88
|
if(!finished) doRedirect()
|
|
83
89
|
})
|
|
84
90
|
onUnmounted(() => {
|
|
@@ -167,6 +167,10 @@
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
+
|
|
171
|
+
import { useLocale } from '@live-change/vue3-components'
|
|
172
|
+
const locale = useLocale()
|
|
173
|
+
|
|
170
174
|
let finished = false
|
|
171
175
|
onMounted(async () => {
|
|
172
176
|
console.log("WAIT FOR USER?", !finished, !api.client.value.user, !finished && !api.client.value.user)
|
|
@@ -176,6 +180,7 @@
|
|
|
176
180
|
}
|
|
177
181
|
console.log("DONE WAITING FOR USER!")
|
|
178
182
|
console.log("FINISHED?", finished)
|
|
183
|
+
locale.captureLocale(true)
|
|
179
184
|
if(!finished) doRedirect()
|
|
180
185
|
})
|
|
181
186
|
onUnmounted(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/user-frontend",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.177",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "tsx --inspect --expose-gc server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "tsx server/start.js localDev --enableSessions --initScript ./init.js --dbAccess",
|
|
@@ -36,29 +36,29 @@
|
|
|
36
36
|
},
|
|
37
37
|
"type": "module",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@live-change/cli": "^0.9.
|
|
40
|
-
"@live-change/dao": "^0.9.
|
|
41
|
-
"@live-change/dao-vue3": "^0.9.
|
|
42
|
-
"@live-change/dao-websocket": "^0.9.
|
|
43
|
-
"@live-change/email-service": "^0.9.
|
|
44
|
-
"@live-change/framework": "^0.9.
|
|
45
|
-
"@live-change/identicon-service": "^0.9.
|
|
46
|
-
"@live-change/image-frontend": "^0.9.
|
|
47
|
-
"@live-change/message-authentication-service": "^0.9.
|
|
48
|
-
"@live-change/notification-service": "^0.9.
|
|
49
|
-
"@live-change/password-authentication-service": "^0.9.
|
|
50
|
-
"@live-change/pattern": "^0.9.
|
|
51
|
-
"@live-change/secret-code-service": "^0.9.
|
|
52
|
-
"@live-change/secret-link-service": "^0.9.
|
|
53
|
-
"@live-change/security-frontend": "^0.9.
|
|
54
|
-
"@live-change/security-service": "^0.9.
|
|
55
|
-
"@live-change/session-service": "^0.9.
|
|
56
|
-
"@live-change/timer-service": "^0.9.
|
|
57
|
-
"@live-change/upload-service": "^0.9.
|
|
58
|
-
"@live-change/user-identification-service": "^0.9.
|
|
59
|
-
"@live-change/user-service": "^0.9.
|
|
60
|
-
"@live-change/vue3-components": "^0.9.
|
|
61
|
-
"@live-change/vue3-ssr": "^0.9.
|
|
39
|
+
"@live-change/cli": "^0.9.177",
|
|
40
|
+
"@live-change/dao": "^0.9.177",
|
|
41
|
+
"@live-change/dao-vue3": "^0.9.177",
|
|
42
|
+
"@live-change/dao-websocket": "^0.9.177",
|
|
43
|
+
"@live-change/email-service": "^0.9.177",
|
|
44
|
+
"@live-change/framework": "^0.9.177",
|
|
45
|
+
"@live-change/identicon-service": "^0.9.177",
|
|
46
|
+
"@live-change/image-frontend": "^0.9.177",
|
|
47
|
+
"@live-change/message-authentication-service": "^0.9.177",
|
|
48
|
+
"@live-change/notification-service": "^0.9.177",
|
|
49
|
+
"@live-change/password-authentication-service": "^0.9.177",
|
|
50
|
+
"@live-change/pattern": "^0.9.177",
|
|
51
|
+
"@live-change/secret-code-service": "^0.9.177",
|
|
52
|
+
"@live-change/secret-link-service": "^0.9.177",
|
|
53
|
+
"@live-change/security-frontend": "^0.9.177",
|
|
54
|
+
"@live-change/security-service": "^0.9.177",
|
|
55
|
+
"@live-change/session-service": "^0.9.177",
|
|
56
|
+
"@live-change/timer-service": "^0.9.177",
|
|
57
|
+
"@live-change/upload-service": "^0.9.177",
|
|
58
|
+
"@live-change/user-identification-service": "^0.9.177",
|
|
59
|
+
"@live-change/user-service": "^0.9.177",
|
|
60
|
+
"@live-change/vue3-components": "^0.9.177",
|
|
61
|
+
"@live-change/vue3-ssr": "^0.9.177",
|
|
62
62
|
"@vueuse/core": "^12.3.0",
|
|
63
63
|
"codeceptjs-assert": "^0.0.5",
|
|
64
64
|
"codeceptjs-video-helper": "0.1.3",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"wtfnode": "^0.9.1"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@live-change/codeceptjs-helper": "^0.9.
|
|
82
|
+
"@live-change/codeceptjs-helper": "^0.9.177",
|
|
83
83
|
"codeceptjs": "^3.6.10",
|
|
84
84
|
"generate-password": "1.7.1",
|
|
85
85
|
"playwright": "1.49.1",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"author": "Michał Łaszczewski <michal@laszczewski.pl>",
|
|
91
91
|
"license": "BSD-3-Clause",
|
|
92
92
|
"description": "",
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "d75c8c63935b7b78623248d255820b1da2676929"
|
|
94
94
|
}
|