From 09349fccf0c83bb02e5d1848061f13eab52294b7 Mon Sep 17 00:00:00 2001 From: Acho Arnold Ewin Date: Thu, 23 Jul 2026 07:45:35 +0300 Subject: [PATCH 1/6] feat(web): collect name during signup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cb465cbe-a93c-4c89-96f5-591e8f0908e3 --- web/app/components/FirebaseAuth.vue | 36 ++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/web/app/components/FirebaseAuth.vue b/web/app/components/FirebaseAuth.vue index 1c8e076af..0c0e4f086 100644 --- a/web/app/components/FirebaseAuth.vue +++ b/web/app/components/FirebaseAuth.vue @@ -7,6 +7,8 @@ import { signInWithEmailAndPassword, createUserWithEmailAndPassword, sendPasswordResetEmail, + updateProfile, + deleteUser, } from 'firebase/auth' import { mdiGoogle, mdiGithub, mdiEmail } from '@mdi/js' import type { User as FirebaseUser } from 'firebase/auth' @@ -29,6 +31,7 @@ const showEmailForm = ref(false) const isSignUp = ref(false) const showForgotPassword = ref(false) const resetEmailSent = ref(false) +const name = ref('') const email = ref('') const password = ref('') const generalError = ref('') @@ -71,6 +74,10 @@ function validateEmail(): boolean { function validateLoginForm(): boolean { clearErrors() let valid = true + if (isSignUp.value && !name.value.trim()) { + errorMessages.value.add('name', 'Please provide your name') + valid = false + } if (!email.value.trim()) { errorMessages.value.add('email', 'Please provide an email address') valid = false @@ -126,6 +133,14 @@ async function submitEmail() { email.value.trim(), password.value, ) + try { + await updateProfile(result.user, { + displayName: name.value.trim(), + }) + } catch (error) { + await deleteUser(result.user) + throw error + } } else { result = await signInWithEmailAndPassword( auth, @@ -167,6 +182,11 @@ function backToSignIn() { showForgotPassword.value = false } +function toggleAuthMode() { + clearErrors() + isSignUp.value = !isSignUp.value +} + function onSuccess(user: FirebaseUser, method: LoginMethod) { try { localStorage.setItem(LAST_LOGIN_METHOD_KEY, method) @@ -405,6 +425,20 @@ function getGeneralErrorMessage( class="mt-4" @submit.prevent="submitEmail" > + {{ isSignUp ? 'Already have an account? Sign In' : 'No account? Sign Up' From 01388e0fa8b184cf815f4480be30d73df6b219d3 Mon Sep 17 00:00:00 2001 From: Acho Arnold Ewin Date: Thu, 23 Jul 2026 07:54:27 +0300 Subject: [PATCH 2/6] fix: do not reset state on logout --- web/app/components/FirebaseAuth.vue | 7 +++++-- web/app/components/MessageThreadHeader.vue | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web/app/components/FirebaseAuth.vue b/web/app/components/FirebaseAuth.vue index 0c0e4f086..7b17597ba 100644 --- a/web/app/components/FirebaseAuth.vue +++ b/web/app/components/FirebaseAuth.vue @@ -434,8 +434,8 @@ function getGeneralErrorMessage( variant="outlined" density="comfortable" class="mb-2" - persistent-hint - hint="e.g John Doe" + persistent-placeholder + placeholder="e.g John Doe" :error="errorMessages.has('name')" :error-messages="errorMessages.get('name')" /> @@ -444,6 +444,8 @@ function getGeneralErrorMessage( label="Email Address" color="primary" type="email" + persistent-placeholder + placeholder="e.g john@gmail.com" variant="outlined" density="comfortable" class="mb-2" @@ -457,6 +459,7 @@ function getGeneralErrorMessage( color="primary" variant="outlined" density="comfortable" + persistent-placeholder class="mb-2" :error="errorMessages.has('password')" :error-messages="errorMessages.get('password')" diff --git a/web/app/components/MessageThreadHeader.vue b/web/app/components/MessageThreadHeader.vue index 1e1a81eb2..6d13a7e20 100644 --- a/web/app/components/MessageThreadHeader.vue +++ b/web/app/components/MessageThreadHeader.vue @@ -27,7 +27,6 @@ const phonesStore = usePhonesStore() const threadsStore = useThreadsStore() const appStore = useAppStore() const notificationsStore = useNotificationsStore() -const redirectPreferenceStore = useRedirectPreferenceStore() const selectedMenuItem = ref(-1) @@ -72,7 +71,6 @@ async function logout() { authStore.resetState() phonesStore.resetState() threadsStore.resetState() - redirectPreferenceStore.resetState() notificationsStore.addNotification({ type: 'info', message: 'You have successfully logged out', From 768cbb48c20cbc644377264f455a25866a6b22af Mon Sep 17 00:00:00 2001 From: Acho Arnold Ewin Date: Thu, 23 Jul 2026 07:58:47 +0300 Subject: [PATCH 3/6] fix(web): preserve signup profile errors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cb465cbe-a93c-4c89-96f5-591e8f0908e3 --- web/app/components/FirebaseAuth.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app/components/FirebaseAuth.vue b/web/app/components/FirebaseAuth.vue index 7b17597ba..1dbc79cf3 100644 --- a/web/app/components/FirebaseAuth.vue +++ b/web/app/components/FirebaseAuth.vue @@ -138,7 +138,11 @@ async function submitEmail() { displayName: name.value.trim(), }) } catch (error) { - await deleteUser(result.user) + try { + await deleteUser(result.user) + } catch (deleteError) { + console.error(deleteError) + } throw error } } else { @@ -435,7 +439,7 @@ function getGeneralErrorMessage( density="comfortable" class="mb-2" persistent-placeholder - placeholder="e.g John Doe" + placeholder="e.g. John Doe" :error="errorMessages.has('name')" :error-messages="errorMessages.get('name')" /> From a1f69ea81133cb73cee59930b437f41fbe7b5632 Mon Sep 17 00:00:00 2001 From: Acho Arnold Ewin Date: Thu, 23 Jul 2026 08:00:54 +0300 Subject: [PATCH 4/6] fix(web): clear redirect preference on logout Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cb465cbe-a93c-4c89-96f5-591e8f0908e3 --- web/app/components/MessageThreadHeader.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/app/components/MessageThreadHeader.vue b/web/app/components/MessageThreadHeader.vue index 6d13a7e20..1e1a81eb2 100644 --- a/web/app/components/MessageThreadHeader.vue +++ b/web/app/components/MessageThreadHeader.vue @@ -27,6 +27,7 @@ const phonesStore = usePhonesStore() const threadsStore = useThreadsStore() const appStore = useAppStore() const notificationsStore = useNotificationsStore() +const redirectPreferenceStore = useRedirectPreferenceStore() const selectedMenuItem = ref(-1) @@ -71,6 +72,7 @@ async function logout() { authStore.resetState() phonesStore.resetState() threadsStore.resetState() + redirectPreferenceStore.resetState() notificationsStore.addNotification({ type: 'info', message: 'You have successfully logged out', From 80f1838aa1bf2c796f57b0abe097f269f07b4bee Mon Sep 17 00:00:00 2001 From: Acho Arnold Ewin Date: Thu, 23 Jul 2026 08:02:19 +0300 Subject: [PATCH 5/6] fix: change plaeholder edits --- web/app/components/FirebaseAuth.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/components/FirebaseAuth.vue b/web/app/components/FirebaseAuth.vue index 1dbc79cf3..bc74ba45f 100644 --- a/web/app/components/FirebaseAuth.vue +++ b/web/app/components/FirebaseAuth.vue @@ -439,7 +439,7 @@ function getGeneralErrorMessage( density="comfortable" class="mb-2" persistent-placeholder - placeholder="e.g. John Doe" + placeholder="Enter your full name e.g. John Doe" :error="errorMessages.has('name')" :error-messages="errorMessages.get('name')" /> @@ -449,7 +449,7 @@ function getGeneralErrorMessage( color="primary" type="email" persistent-placeholder - placeholder="e.g john@gmail.com" + placeholder="Enter your email address e.g john@gmail.com" variant="outlined" density="comfortable" class="mb-2" @@ -463,6 +463,7 @@ function getGeneralErrorMessage( color="primary" variant="outlined" density="comfortable" + placeholder="Create a password" persistent-placeholder class="mb-2" :error="errorMessages.has('password')" From 1ad3cbc74aac5c184039c991514d00f3c245c945 Mon Sep 17 00:00:00 2001 From: Acho Arnold Ewin Date: Thu, 23 Jul 2026 08:09:47 +0300 Subject: [PATCH 6/6] style: fix typo --- web/app/components/FirebaseAuth.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/FirebaseAuth.vue b/web/app/components/FirebaseAuth.vue index bc74ba45f..5f783e07c 100644 --- a/web/app/components/FirebaseAuth.vue +++ b/web/app/components/FirebaseAuth.vue @@ -439,7 +439,7 @@ function getGeneralErrorMessage( density="comfortable" class="mb-2" persistent-placeholder - placeholder="Enter your full name e.g. John Doe" + placeholder="Enter your full name (e.g. John Doe)" :error="errorMessages.has('name')" :error-messages="errorMessages.get('name')" /> @@ -449,7 +449,7 @@ function getGeneralErrorMessage( color="primary" type="email" persistent-placeholder - placeholder="Enter your email address e.g john@gmail.com" + placeholder="Enter your email address (e.g. john@gmail.com)" variant="outlined" density="comfortable" class="mb-2" @@ -463,7 +463,7 @@ function getGeneralErrorMessage( color="primary" variant="outlined" density="comfortable" - placeholder="Create a password" + placeholder="Create a secure /password" persistent-placeholder class="mb-2" :error="errorMessages.has('password')"