diff --git a/src/app/components/form/account/FormAccountSignIn.vue b/src/app/components/form/account/FormAccountSignIn.vue index bdfbc1f823..672be1016e 100644 --- a/src/app/components/form/account/FormAccountSignIn.vue +++ b/src/app/components/form/account/FormAccountSignIn.vue @@ -7,11 +7,10 @@ :submit-name="t('signIn')" @submit.prevent="submit" > - - (), password: ref(), - username: ref(), + usernameOrEmail: ref(), }) const isFormSent = ref(false) const modelError = defineModel('error') @@ -75,7 +74,7 @@ const submit = async () => { const result = await authenticateMutation.executeMutation( { - username: form.username || '', + username: form.usernameOrEmail || '', password: form.password || '', }, { @@ -110,7 +109,7 @@ const submit = async () => { // vuelidate const rules = { captcha: VALIDATION_CAPTCHA(), - username: VALIDATION_EMAIL_ADDRESS({ isRequired: true }), + usernameOrEmail: VALIDATION_USERNAME_OR_EMAIL({ isRequired: true }), password: VALIDATION_PASSWORD(), } const v$ = useVuelidate(rules, form) diff --git a/src/app/components/form/input/FormInputEmailUsername.vue b/src/app/components/form/input/FormInputEmailUsername.vue new file mode 100644 index 0000000000..cd28d1b17c --- /dev/null +++ b/src/app/components/form/input/FormInputEmailUsername.vue @@ -0,0 +1,94 @@ + + + + + +de: + usernameOrEmail: Benutzername oder E-Mail-Adresse +en: + usernameOrEmail: Username or Email address + diff --git a/src/app/utils/validation.ts b/src/app/utils/validation.ts index 10ad0fb254..38ea98e18d 100644 --- a/src/app/utils/validation.ts +++ b/src/app/utils/validation.ts @@ -237,3 +237,29 @@ export const validateUsername = (invert?: boolean) => async (value: string) => { ? !result.data?.accountByUsername : !!result.data?.accountByUsername } + +export const VALIDATION_USERNAME_OR_EMAIL = ({ + isRequired, +}: { + isRequired?: boolean +}) => ({ + format: (value: string) => { + if (!value) return true + if (value.includes('@')) { + return email.$validator(value, undefined, undefined) + } else { + return VALIDATION_FORMAT_SLUG(value) + } + }, + lengthMax: { + $validator: (value: string) => { + if (!value) return true + if (value.includes('@')) { + return value.length <= VALIDATION_EMAIL_ADDRESS_LENGTH_MAXIMUM + } else { + return value.length <= VALIDATION_USERNAME_LENGTH_MAXIMUM + } + }, + }, + ...(isRequired ? { required } : {}), +}) diff --git a/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Chrome-linux.png b/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Chrome-linux.png index e875bec6c8..d4e71e1a0e 100644 Binary files a/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Chrome-linux.png and b/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Chrome-linux.png differ diff --git a/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Safari-linux.png b/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Safari-linux.png index f66b0eb94c..35e5db2581 100644 Binary files a/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Safari-linux.png and b/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-Mobile-Safari-linux.png differ diff --git a/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-chromium-linux.png b/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-chromium-linux.png index 9a64512e67..2170ba52d5 100644 Binary files a/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-chromium-linux.png and b/tests/e2e/specs/pages/task/taskAccountSignIn.spec.ts-snapshots/visual-regression-looks-as-before-1-chromium-linux.png differ diff --git a/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-Mobile-Chrome-darwin.xml b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-Mobile-Chrome-darwin.xml new file mode 100644 index 0000000000..6dc7bc94f4 --- /dev/null +++ b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-Mobile-Chrome-darwin.xml @@ -0,0 +1,159 @@ + + + + https://localhost:3000/de + + + + + + https://localhost:3000/de/contact + + + + + + https://localhost:3000/de/dashboard + + + + + + https://localhost:3000/de/event + + + + + + https://localhost:3000/de/notification + + + + + + https://localhost:3000/de/upload + + + + + + https://localhost:3000/de/account/create + + + + + + https://localhost:3000/de/docs/app + + + + + + https://localhost:3000/de/docs/browser-support + + + + + + https://localhost:3000/de/early-bird/create + + + + + + https://localhost:3000/de/event/create + + + + + + https://localhost:3000/de/flow/welcome + + + + + + https://localhost:3000/de/guest/unlock + + + + + + https://localhost:3000/de/session/create + + + + + + https://localhost:3000/de/session/edit + + + + + + https://localhost:3000/de/support/contact + + + + + + https://localhost:3000/de/docs/legal/attributions + + + + + + https://localhost:3000/de/docs/legal/conduct + + + + + + https://localhost:3000/de/docs/legal/imprint + + + + + + https://localhost:3000/de/docs/legal/privacy + + + + + + https://localhost:3000/de/docs/legal/terms + + + + + + https://localhost:3000/de/event/ingest/image + + + + + + https://localhost:3000/de/event/ingest/url + + + + + + https://localhost:3000/de/session/edit/color-scheme + + + + + + https://localhost:3000/de/session/edit/language + + + + + + https://localhost:3000/de/account/password/reset/request + + + + + \ No newline at end of file diff --git a/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-Mobile-Safari-darwin.xml b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-Mobile-Safari-darwin.xml new file mode 100644 index 0000000000..6dc7bc94f4 --- /dev/null +++ b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-Mobile-Safari-darwin.xml @@ -0,0 +1,159 @@ + + + + https://localhost:3000/de + + + + + + https://localhost:3000/de/contact + + + + + + https://localhost:3000/de/dashboard + + + + + + https://localhost:3000/de/event + + + + + + https://localhost:3000/de/notification + + + + + + https://localhost:3000/de/upload + + + + + + https://localhost:3000/de/account/create + + + + + + https://localhost:3000/de/docs/app + + + + + + https://localhost:3000/de/docs/browser-support + + + + + + https://localhost:3000/de/early-bird/create + + + + + + https://localhost:3000/de/event/create + + + + + + https://localhost:3000/de/flow/welcome + + + + + + https://localhost:3000/de/guest/unlock + + + + + + https://localhost:3000/de/session/create + + + + + + https://localhost:3000/de/session/edit + + + + + + https://localhost:3000/de/support/contact + + + + + + https://localhost:3000/de/docs/legal/attributions + + + + + + https://localhost:3000/de/docs/legal/conduct + + + + + + https://localhost:3000/de/docs/legal/imprint + + + + + + https://localhost:3000/de/docs/legal/privacy + + + + + + https://localhost:3000/de/docs/legal/terms + + + + + + https://localhost:3000/de/event/ingest/image + + + + + + https://localhost:3000/de/event/ingest/url + + + + + + https://localhost:3000/de/session/edit/color-scheme + + + + + + https://localhost:3000/de/session/edit/language + + + + + + https://localhost:3000/de/account/password/reset/request + + + + + \ No newline at end of file diff --git a/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-chromium-darwin.xml b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-chromium-darwin.xml new file mode 100644 index 0000000000..6dc7bc94f4 --- /dev/null +++ b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-chromium-darwin.xml @@ -0,0 +1,159 @@ + + + + https://localhost:3000/de + + + + + + https://localhost:3000/de/contact + + + + + + https://localhost:3000/de/dashboard + + + + + + https://localhost:3000/de/event + + + + + + https://localhost:3000/de/notification + + + + + + https://localhost:3000/de/upload + + + + + + https://localhost:3000/de/account/create + + + + + + https://localhost:3000/de/docs/app + + + + + + https://localhost:3000/de/docs/browser-support + + + + + + https://localhost:3000/de/early-bird/create + + + + + + https://localhost:3000/de/event/create + + + + + + https://localhost:3000/de/flow/welcome + + + + + + https://localhost:3000/de/guest/unlock + + + + + + https://localhost:3000/de/session/create + + + + + + https://localhost:3000/de/session/edit + + + + + + https://localhost:3000/de/support/contact + + + + + + https://localhost:3000/de/docs/legal/attributions + + + + + + https://localhost:3000/de/docs/legal/conduct + + + + + + https://localhost:3000/de/docs/legal/imprint + + + + + + https://localhost:3000/de/docs/legal/privacy + + + + + + https://localhost:3000/de/docs/legal/terms + + + + + + https://localhost:3000/de/event/ingest/image + + + + + + https://localhost:3000/de/event/ingest/url + + + + + + https://localhost:3000/de/session/edit/color-scheme + + + + + + https://localhost:3000/de/session/edit/language + + + + + + https://localhost:3000/de/account/password/reset/request + + + + + \ No newline at end of file diff --git a/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-Mobile-Chrome-darwin.xml b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-Mobile-Chrome-darwin.xml new file mode 100644 index 0000000000..57d33032fd --- /dev/null +++ b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-Mobile-Chrome-darwin.xml @@ -0,0 +1,159 @@ + + + + https://localhost:3000/ + + + + + + https://localhost:3000/contact + + + + + + https://localhost:3000/dashboard + + + + + + https://localhost:3000/event + + + + + + https://localhost:3000/notification + + + + + + https://localhost:3000/upload + + + + + + https://localhost:3000/account/create + + + + + + https://localhost:3000/docs/app + + + + + + https://localhost:3000/docs/browser-support + + + + + + https://localhost:3000/early-bird/create + + + + + + https://localhost:3000/event/create + + + + + + https://localhost:3000/flow/welcome + + + + + + https://localhost:3000/guest/unlock + + + + + + https://localhost:3000/session/create + + + + + + https://localhost:3000/session/edit + + + + + + https://localhost:3000/support/contact + + + + + + https://localhost:3000/docs/legal/attributions + + + + + + https://localhost:3000/docs/legal/conduct + + + + + + https://localhost:3000/docs/legal/imprint + + + + + + https://localhost:3000/docs/legal/privacy + + + + + + https://localhost:3000/docs/legal/terms + + + + + + https://localhost:3000/event/ingest/image + + + + + + https://localhost:3000/event/ingest/url + + + + + + https://localhost:3000/session/edit/color-scheme + + + + + + https://localhost:3000/session/edit/language + + + + + + https://localhost:3000/account/password/reset/request + + + + + \ No newline at end of file diff --git a/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-Mobile-Safari-darwin.xml b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-Mobile-Safari-darwin.xml new file mode 100644 index 0000000000..57d33032fd --- /dev/null +++ b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-Mobile-Safari-darwin.xml @@ -0,0 +1,159 @@ + + + + https://localhost:3000/ + + + + + + https://localhost:3000/contact + + + + + + https://localhost:3000/dashboard + + + + + + https://localhost:3000/event + + + + + + https://localhost:3000/notification + + + + + + https://localhost:3000/upload + + + + + + https://localhost:3000/account/create + + + + + + https://localhost:3000/docs/app + + + + + + https://localhost:3000/docs/browser-support + + + + + + https://localhost:3000/early-bird/create + + + + + + https://localhost:3000/event/create + + + + + + https://localhost:3000/flow/welcome + + + + + + https://localhost:3000/guest/unlock + + + + + + https://localhost:3000/session/create + + + + + + https://localhost:3000/session/edit + + + + + + https://localhost:3000/support/contact + + + + + + https://localhost:3000/docs/legal/attributions + + + + + + https://localhost:3000/docs/legal/conduct + + + + + + https://localhost:3000/docs/legal/imprint + + + + + + https://localhost:3000/docs/legal/privacy + + + + + + https://localhost:3000/docs/legal/terms + + + + + + https://localhost:3000/event/ingest/image + + + + + + https://localhost:3000/event/ingest/url + + + + + + https://localhost:3000/session/edit/color-scheme + + + + + + https://localhost:3000/session/edit/language + + + + + + https://localhost:3000/account/password/reset/request + + + + + \ No newline at end of file diff --git a/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-chromium-darwin.xml b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-chromium-darwin.xml new file mode 100644 index 0000000000..57d33032fd --- /dev/null +++ b/tests/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-chromium-darwin.xml @@ -0,0 +1,159 @@ + + + + https://localhost:3000/ + + + + + + https://localhost:3000/contact + + + + + + https://localhost:3000/dashboard + + + + + + https://localhost:3000/event + + + + + + https://localhost:3000/notification + + + + + + https://localhost:3000/upload + + + + + + https://localhost:3000/account/create + + + + + + https://localhost:3000/docs/app + + + + + + https://localhost:3000/docs/browser-support + + + + + + https://localhost:3000/early-bird/create + + + + + + https://localhost:3000/event/create + + + + + + https://localhost:3000/flow/welcome + + + + + + https://localhost:3000/guest/unlock + + + + + + https://localhost:3000/session/create + + + + + + https://localhost:3000/session/edit + + + + + + https://localhost:3000/support/contact + + + + + + https://localhost:3000/docs/legal/attributions + + + + + + https://localhost:3000/docs/legal/conduct + + + + + + https://localhost:3000/docs/legal/imprint + + + + + + https://localhost:3000/docs/legal/privacy + + + + + + https://localhost:3000/docs/legal/terms + + + + + + https://localhost:3000/event/ingest/image + + + + + + https://localhost:3000/event/ingest/url + + + + + + https://localhost:3000/session/edit/color-scheme + + + + + + https://localhost:3000/session/edit/language + + + + + + https://localhost:3000/account/password/reset/request + + + + + \ No newline at end of file