@sowell/quasar-app-extension-auth 1.8.1 → 1.8.2
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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, Ref } from "vue"
|
|
1
|
+
import { computed, ref, watch, Ref } from "vue"
|
|
2
2
|
import { useI18n } from "vue-i18n"
|
|
3
3
|
import { AxiosError } from "axios"
|
|
4
4
|
import {
|
|
@@ -91,9 +91,10 @@ export function useValidateMagicLink(magicToken: Ref<string>) {
|
|
|
91
91
|
confirmPassword.value !== ""
|
|
92
92
|
)
|
|
93
93
|
|
|
94
|
-
// NOTE: rules return a boolean
|
|
95
|
-
// the fields already explains exactly what's missing (green/gray/red), so
|
|
96
|
-
// field itself only needs to turn red
|
|
94
|
+
// NOTE: rules return a boolean rather than a string - the requirements checklist
|
|
95
|
+
// below the fields already explains exactly what's missing (green/gray/red), so
|
|
96
|
+
// the field itself only needs to turn red. The only exception is the "passwords
|
|
97
|
+
// don't match" case: no checklist item covers it, so that one needs its message.
|
|
97
98
|
const validations = {
|
|
98
99
|
passwordRules: [
|
|
99
100
|
(val: string) => !!val || false,
|
|
@@ -101,10 +102,18 @@ export function useValidateMagicLink(magicToken: Ref<string>) {
|
|
|
101
102
|
],
|
|
102
103
|
passwordConfirmationRules: [
|
|
103
104
|
(val: string) => !!val || false,
|
|
104
|
-
(val: string) =>
|
|
105
|
+
(val: string) =>
|
|
106
|
+
val === password.value || t("auth.newPasswordConfirmationFailed")
|
|
105
107
|
]
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
// Quasar's lazy-rules only re-validates the confirmation field on blur/submit,
|
|
111
|
+
// never while typing. Without this, the "passwords don't match" message stays
|
|
112
|
+
// on screen while the user is already fixing the field.
|
|
113
|
+
watch([password, confirmPassword], () => {
|
|
114
|
+
confirmPasswordInput.value?.resetValidation()
|
|
115
|
+
})
|
|
116
|
+
|
|
108
117
|
const readApiError = (error: unknown): string | undefined => {
|
|
109
118
|
const axiosError = error as AxiosError<ApiErrorPayload>
|
|
110
119
|
const apiError = axiosError.response?.data?.errors?.[0]
|
package/src/i18n/fr-FR/index.ts
CHANGED
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
confirmPassword: "Confirmer le mot de passe",
|
|
28
28
|
confirmPasswordPlaceholder: "Répéter le mot de passe",
|
|
29
29
|
newPasswordConfirmationFailed:
|
|
30
|
-
"Les
|
|
30
|
+
"Les mots de passe que vous avez saisi ne correspondent pas",
|
|
31
31
|
passwordRequirementsError:
|
|
32
32
|
"Le mot de passe ne respecte pas les critères requis",
|
|
33
33
|
passwordSequenceError:
|