@live-change/user-frontend 0.9.111 → 0.9.113

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.
@@ -5,7 +5,9 @@
5
5
  "codeNotFound": "Secret code not recognized.",
6
6
  "codeExpired": "Secret code expired.",
7
7
  "wrongPassword": "Wrong password.",
8
- "emailNotFound": "Email not found."
8
+ "emailNotFound": "Email not found.",
9
+ "unsafePassword": "Password is unsafe, try to use a stronger one.",
10
+ "passwordNotMatch": "Passwords do not match."
9
11
  },
10
12
  "app": {
11
13
  "updateAvailable": "Update available!",
@@ -95,7 +95,7 @@
95
95
  form.value.addValidator('passwordHash', () => {
96
96
  const value = form.value.getFieldValue('passwordHash')
97
97
  console.log("PASSWORDS MATCH?", secondPassword.value, value)
98
- if(value !== secondPassword.value) return "passwordsNotMatch"
98
+ if(value !== secondPassword.value) return "passwordNotMatch"
99
99
  })
100
100
  })
101
101
 
@@ -15,14 +15,15 @@
15
15
  <p class="mt-0 mb-6 p-0 leading-normal">Your password reset authentication already expired.</p>
16
16
  </div>
17
17
 
18
- <div class="bg-surface-0 dark:bg-surface-900 p-6 shadow rounded-border" v-if="isReady">
18
+ <div class="bg-surface-0 dark:bg-surface-900 p-6 shadow rounded-border" v-if="isReady || working">
19
19
  <div class="text-center mb-8">
20
20
  <div class="text-surface-900 dark:text-surface-0 text-3xl font-medium mb-4">Reset password</div>
21
21
  </div>
22
22
 
23
23
  <command-form service="passwordAuthentication" action="finishResetPassword" v-slot="{ data }"
24
24
  :parameters="{ key: resetKey }" ref="form"
25
- @done="handleDone" keepOnDone>
25
+ @done="handleDone" keepOnDone
26
+ @submit="handleSubmit" @error="handleError">
26
27
 
27
28
  <template v-if="isMounted">
28
29
  <div class="p-field mb-4">
@@ -59,6 +60,10 @@
59
60
 
60
61
  </command-form>
61
62
  </div>
63
+ <div v-if="redirecting"
64
+ class="bg-surface-0 dark:bg-surface-900 rounded-border shadow p-6 flex justify-center">
65
+ <ProgressSpinner class="m-4" />
66
+ </div>
62
67
  </div>
63
68
  </template>
64
69
 
@@ -77,6 +82,9 @@
77
82
  }
78
83
  })
79
84
 
85
+ import { useI18n } from 'vue-i18n'
86
+ const { t } = useI18n()
87
+
80
88
  import { useNow } from '@vueuse/core'
81
89
  const now = useNow({ interval: 1000 })
82
90
 
@@ -87,7 +95,7 @@
87
95
  form.value.addValidator('passwordHash', () => {
88
96
  const value = form.value.getFieldValue('passwordHash')
89
97
  console.log("PASSWORDS MATCH?", secondPassword.value, value)
90
- if(value !== secondPassword.value) return "passwordsNotMatch"
98
+ if(value !== secondPassword.value) return "passwordNotMatch"
91
99
  })
92
100
  })
93
101
 
@@ -102,14 +110,27 @@
102
110
  live( path().passwordAuthentication.resetPasswordAuthenticationByKey({ key: resetKey }) )
103
111
  ])
104
112
 
113
+ const working = ref(false)
114
+ const redirecting = ref(false)
115
+
105
116
  const isUnknown = computed(() => authentication.value === null)
106
117
  const isExpired = computed(() =>
107
118
  authentication.value ? (now.value.toISOString() > authentication.value.expire) : false )
108
- const isUsed = computed(() => authentication.value && authentication.value.state === 'used')
109
- const isReady = computed(() => !(isUnknown.value || isExpired.value || isUsed.value))
119
+ const isUsed = computed(() => !working.value && !redirecting.value && authentication.value && authentication.value.state === 'used')
120
+ const isReady = computed(() => !(isUnknown.value || isExpired.value || isUsed.value))
121
+
122
+ function handleSubmit() {
123
+ working.value = true
124
+ }
125
+
126
+ function handleError() {
127
+ working.value = false
128
+ }
110
129
 
111
130
  function handleDone({ parameters, result }) {
112
131
  console.log("DONE RESULT", result)
132
+ redirecting.value = true
133
+ working.value = false
113
134
  router.push({
114
135
  name: 'user:resetPasswordFinished'
115
136
  })
@@ -41,7 +41,9 @@
41
41
  <template v-if="isMounted">
42
42
 
43
43
  <div class="p-field mb-4">
44
- <label for="newPassword" class="block text-surface-900 dark:text-surface-0 font-medium mb-2">New password</label>
44
+ <label for="newPassword" class="block text-surface-900 dark:text-surface-0 font-medium mb-2">
45
+ New password
46
+ </label>
45
47
  <Password id="newPassword" class="w-full" inputClass="w-full"
46
48
  toggleMask v-model:masked="masked"
47
49
  :invalid="!!data.passwordHashError"
@@ -101,6 +103,9 @@
101
103
  import { useRouter } from 'vue-router'
102
104
  const router = useRouter()
103
105
 
106
+ import { useI18n } from 'vue-i18n'
107
+ const { t } = useI18n()
108
+
104
109
  const isMounted = ref(false)
105
110
  onMounted(() => isMounted.value = true)
106
111
 
@@ -109,6 +114,14 @@
109
114
 
110
115
  const masked = ref(true)
111
116
 
117
+ onMounted(() => {
118
+ form.value.addValidator('passwordHash', () => {
119
+ const value = form.value.getFieldValue('passwordHash')
120
+ console.log("PASSWORDS MATCH?", secondPassword.value, value)
121
+ if(value !== secondPassword.value) return "passwordNotMatch"
122
+ })
123
+ })
124
+
112
125
  import { useToast } from 'primevue/usetoast'
113
126
  const toast = useToast()
114
127
  import { useConfirm } from 'primevue/useconfirm'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/user-frontend",
3
- "version": "0.9.111",
3
+ "version": "0.9.113",
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.111",
26
- "@live-change/dao": "^0.9.111",
27
- "@live-change/dao-vue3": "^0.9.111",
28
- "@live-change/dao-websocket": "^0.9.111",
29
- "@live-change/email-service": "^0.9.111",
30
- "@live-change/framework": "^0.9.111",
31
- "@live-change/identicon-service": "^0.9.111",
32
- "@live-change/image-frontend": "^0.9.111",
33
- "@live-change/message-authentication-service": "^0.9.111",
34
- "@live-change/notification-service": "^0.9.111",
35
- "@live-change/password-authentication-service": "^0.9.111",
36
- "@live-change/pattern": "^0.9.111",
37
- "@live-change/secret-code-service": "^0.9.111",
38
- "@live-change/secret-link-service": "^0.9.111",
39
- "@live-change/security-frontend": "^0.9.111",
40
- "@live-change/security-service": "^0.9.111",
41
- "@live-change/session-service": "^0.9.111",
42
- "@live-change/timer-service": "^0.9.111",
43
- "@live-change/upload-service": "^0.9.111",
44
- "@live-change/user-identification-service": "^0.9.111",
45
- "@live-change/user-service": "^0.9.111",
46
- "@live-change/vue3-components": "^0.9.111",
47
- "@live-change/vue3-ssr": "^0.9.111",
25
+ "@live-change/cli": "^0.9.113",
26
+ "@live-change/dao": "^0.9.113",
27
+ "@live-change/dao-vue3": "^0.9.113",
28
+ "@live-change/dao-websocket": "^0.9.113",
29
+ "@live-change/email-service": "^0.9.113",
30
+ "@live-change/framework": "^0.9.113",
31
+ "@live-change/identicon-service": "^0.9.113",
32
+ "@live-change/image-frontend": "^0.9.113",
33
+ "@live-change/message-authentication-service": "^0.9.113",
34
+ "@live-change/notification-service": "^0.9.113",
35
+ "@live-change/password-authentication-service": "^0.9.113",
36
+ "@live-change/pattern": "^0.9.113",
37
+ "@live-change/secret-code-service": "^0.9.113",
38
+ "@live-change/secret-link-service": "^0.9.113",
39
+ "@live-change/security-frontend": "^0.9.113",
40
+ "@live-change/security-service": "^0.9.113",
41
+ "@live-change/session-service": "^0.9.113",
42
+ "@live-change/timer-service": "^0.9.113",
43
+ "@live-change/upload-service": "^0.9.113",
44
+ "@live-change/user-identification-service": "^0.9.113",
45
+ "@live-change/user-service": "^0.9.113",
46
+ "@live-change/vue3-components": "^0.9.113",
47
+ "@live-change/vue3-ssr": "^0.9.113",
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.111",
68
+ "@live-change/codeceptjs-helper": "^0.9.113",
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": "ab89b1aad3a6c7b88151b9b2e2b56bf749ea3584"
79
+ "gitHead": "8bf5b441c3b006618e5d2c0cc9acc838b405ed3d"
80
80
  }