@live-change/user-frontend 0.9.21 → 0.9.22
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.
|
@@ -34,17 +34,42 @@
|
|
|
34
34
|
|
|
35
35
|
import pluralize from 'pluralize'
|
|
36
36
|
|
|
37
|
+
import { useApi } from "@live-change/vue3-ssr"
|
|
38
|
+
const api = useApi()
|
|
39
|
+
|
|
40
|
+
import { useToast } from 'primevue/usetoast'
|
|
41
|
+
const toast = useToast()
|
|
42
|
+
import { useConfirm } from 'primevue/useconfirm'
|
|
43
|
+
const confirm = useConfirm()
|
|
44
|
+
|
|
45
|
+
const userClientConfig = api.getServiceDefinition('user')?.clientConfig
|
|
46
|
+
|
|
37
47
|
const afterSignIn = computed( () => isMounted.value && localStorage.redirectAfterSignIn )
|
|
38
48
|
const redirectTime = ref()
|
|
39
49
|
let timeout
|
|
40
50
|
onMounted(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
if(localStorage.redirectAfterSignIn) {
|
|
52
|
+
const route = JSON.parse(localStorage.redirectAfterSignIn)
|
|
53
|
+
console.error("ROUTE!", route)
|
|
54
|
+
localStorage.removeItem('redirectAfterSignIn')
|
|
55
|
+
const delay = route?.meta?.afterSignInRedirectDelay ?? userClientConfig?.afterSignInRedirectDelay ?? 10
|
|
56
|
+
delete route.meta
|
|
57
|
+
if(delay) {
|
|
58
|
+
redirectTime.value = new Date(Date.now() + delay * 1000)
|
|
59
|
+
timeout = setTimeout(() => {
|
|
60
|
+
if(afterSignIn.value) {
|
|
61
|
+
router.push(route)
|
|
62
|
+
}
|
|
63
|
+
}, redirectTime.value - currentTime.value)
|
|
64
|
+
} else {
|
|
65
|
+
toast.add({
|
|
66
|
+
severity: 'info', life: 6000,
|
|
67
|
+
summary: 'Signed in',
|
|
68
|
+
detail: 'Congratulations! You have successfully logged in to your account.'
|
|
69
|
+
})
|
|
70
|
+
router.push(route)
|
|
46
71
|
}
|
|
47
|
-
}
|
|
72
|
+
}
|
|
48
73
|
})
|
|
49
74
|
onUnmounted(() => {
|
|
50
75
|
clearTimeout(timeout)
|
|
@@ -105,6 +105,13 @@
|
|
|
105
105
|
|
|
106
106
|
const masked = ref(true)
|
|
107
107
|
|
|
108
|
+
import { useToast } from 'primevue/usetoast'
|
|
109
|
+
const toast = useToast()
|
|
110
|
+
import { useConfirm } from 'primevue/useconfirm'
|
|
111
|
+
const confirm = useConfirm()
|
|
112
|
+
|
|
113
|
+
const userClientConfig = api.getServiceDefinition('user')?.clientConfig
|
|
114
|
+
|
|
108
115
|
const [passwordExists, emails, phones] = await Promise.all([
|
|
109
116
|
live(path().passwordAuthentication.myUserPasswordAuthenticationExists()),
|
|
110
117
|
live(path().email?.myUserEmails()),
|
|
@@ -115,13 +122,27 @@
|
|
|
115
122
|
const redirectTime = ref()
|
|
116
123
|
let timeout
|
|
117
124
|
onMounted(() => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
if(localStorage.redirectAfterSignIn) {
|
|
126
|
+
localStorage.removeItem('redirectAfterSignIn')
|
|
127
|
+
const route = JSON.parse(afterSignIn.value)
|
|
128
|
+
const delay = route?.meta?.afterSignInRedirectDelay ?? userClientConfig?.afterSignInRedirectDelay ?? 10
|
|
129
|
+
delete route.meta
|
|
130
|
+
if(delay) {
|
|
131
|
+
redirectTime.value = new Date(Date.now() + delay * 1000)
|
|
132
|
+
timeout = setTimeout(() => {
|
|
133
|
+
if(afterSignIn.value) {
|
|
134
|
+
router.push(route)
|
|
135
|
+
}
|
|
136
|
+
}, redirectTime.value - currentTime.value)
|
|
137
|
+
} else {
|
|
138
|
+
toast.add({
|
|
139
|
+
severity: 'info', life: 6000,
|
|
140
|
+
summary: 'Signed up',
|
|
141
|
+
detail: 'Congratulations! You have successfully created your account.'
|
|
142
|
+
})
|
|
143
|
+
router.push(route)
|
|
123
144
|
}
|
|
124
|
-
}
|
|
145
|
+
}
|
|
125
146
|
})
|
|
126
147
|
onUnmounted(() => {
|
|
127
148
|
clearTimeout(timeout)
|
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.22",
|
|
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",
|
|
@@ -22,29 +22,29 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@live-change/cli": "^0.9.
|
|
26
|
-
"@live-change/dao": "^0.9.
|
|
27
|
-
"@live-change/dao-vue3": "^0.9.
|
|
28
|
-
"@live-change/dao-websocket": "^0.9.
|
|
29
|
-
"@live-change/email-service": "^0.9.
|
|
30
|
-
"@live-change/framework": "^0.9.
|
|
31
|
-
"@live-change/identicon-service": "^0.9.
|
|
32
|
-
"@live-change/image-frontend": "^0.9.
|
|
33
|
-
"@live-change/message-authentication-service": "^0.9.
|
|
34
|
-
"@live-change/notification-service": "^0.9.
|
|
35
|
-
"@live-change/password-authentication-service": "^0.9.
|
|
36
|
-
"@live-change/pattern": "^0.9.
|
|
37
|
-
"@live-change/secret-code-service": "^0.9.
|
|
38
|
-
"@live-change/secret-link-service": "^0.9.
|
|
39
|
-
"@live-change/security-frontend": "^0.9.
|
|
40
|
-
"@live-change/security-service": "^0.9.
|
|
41
|
-
"@live-change/session-service": "^0.9.
|
|
42
|
-
"@live-change/timer-service": "^0.9.
|
|
43
|
-
"@live-change/upload-service": "^0.9.
|
|
44
|
-
"@live-change/user-identification-service": "^0.9.
|
|
45
|
-
"@live-change/user-service": "^0.9.
|
|
46
|
-
"@live-change/vue3-components": "^0.9.
|
|
47
|
-
"@live-change/vue3-ssr": "^0.9.
|
|
25
|
+
"@live-change/cli": "^0.9.22",
|
|
26
|
+
"@live-change/dao": "^0.9.22",
|
|
27
|
+
"@live-change/dao-vue3": "^0.9.22",
|
|
28
|
+
"@live-change/dao-websocket": "^0.9.22",
|
|
29
|
+
"@live-change/email-service": "^0.9.22",
|
|
30
|
+
"@live-change/framework": "^0.9.22",
|
|
31
|
+
"@live-change/identicon-service": "^0.9.22",
|
|
32
|
+
"@live-change/image-frontend": "^0.9.22",
|
|
33
|
+
"@live-change/message-authentication-service": "^0.9.22",
|
|
34
|
+
"@live-change/notification-service": "^0.9.22",
|
|
35
|
+
"@live-change/password-authentication-service": "^0.9.22",
|
|
36
|
+
"@live-change/pattern": "^0.9.22",
|
|
37
|
+
"@live-change/secret-code-service": "^0.9.22",
|
|
38
|
+
"@live-change/secret-link-service": "^0.9.22",
|
|
39
|
+
"@live-change/security-frontend": "^0.9.22",
|
|
40
|
+
"@live-change/security-service": "^0.9.22",
|
|
41
|
+
"@live-change/session-service": "^0.9.22",
|
|
42
|
+
"@live-change/timer-service": "^0.9.22",
|
|
43
|
+
"@live-change/upload-service": "^0.9.22",
|
|
44
|
+
"@live-change/user-identification-service": "^0.9.22",
|
|
45
|
+
"@live-change/user-service": "^0.9.22",
|
|
46
|
+
"@live-change/vue3-components": "^0.9.22",
|
|
47
|
+
"@live-change/vue3-ssr": "^0.9.22",
|
|
48
48
|
"@vueuse/core": "^12.3.0",
|
|
49
49
|
"codeceptjs-assert": "^0.0.5",
|
|
50
50
|
"codeceptjs-video-helper": "0.1.3",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"wtfnode": "^0.9.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@live-change/codeceptjs-helper": "^0.9.
|
|
68
|
+
"@live-change/codeceptjs-helper": "^0.9.22",
|
|
69
69
|
"codeceptjs": "^3.6.10",
|
|
70
70
|
"generate-password": "1.7.1",
|
|
71
71
|
"playwright": "1.49.1",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"author": "Michał Łaszczewski <michal@laszczewski.pl>",
|
|
77
77
|
"license": "BSD-3-Clause",
|
|
78
78
|
"description": "",
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "fd2681b5cefacd62d4a64b8276f0513b01f8a020"
|
|
80
80
|
}
|