From 605bd735615bc49bbdd114dbe0721ce027bb872a Mon Sep 17 00:00:00 2001 From: jableader Date: Sat, 1 Nov 2025 17:47:42 +1100 Subject: [PATCH] chore(auth/tests): remove legacy username login from tests; align mocks with email/password-only auth and keep suite green --- frontend-spec.md | 2 ++ src/api/auth.ts | 6 +---- src/components/LoginPage.vue | 38 ++++------------------------- src/composables/useAuth.ts | 9 +++---- tests/useAuth.createAccount.test.ts | 1 - tests/useAuth.multitenant.test.ts | 6 ----- 6 files changed, 11 insertions(+), 51 deletions(-) diff --git a/frontend-spec.md b/frontend-spec.md index 14bc1ab..675e4ce 100644 --- a/frontend-spec.md +++ b/frontend-spec.md @@ -245,3 +245,5 @@ Google OAuth is planned next. - Replace temporary raw fetch calls (persons, parse, members listing) with typed endpoints when available. - Implement Google OAuth login and account creation flows. - Review `MyShoppingPage` usage and remove legacy `getMyShoppingList/saveMyShoppingList` stubs when UI is refactored or removed. +- Remove the legacy username login shim (`login(username: string)`) and any fallback UI; standardize on email/password (and Google) only. +- Rollout flag: default `VUE_APP_MULTITENANT_ENABLED` to true across environments and plan removal of legacy flat routes and related tests once stable. diff --git a/src/api/auth.ts b/src/api/auth.ts index 0cf099d..763ed87 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -38,11 +38,7 @@ export async function currentUser(): Promise { } } -export async function login(username: string): Promise { - // Legacy compatibility shim: avoid network call; will be removed with new LoginPage - cachedUser = { id: -1, email: '', displayName: username } - return cachedUser -} +// Legacy username login has been removed; use loginWithPassword instead. // New multitenant-ready API surface export async function loginWithPassword(email: string, password: string): Promise { diff --git a/src/components/LoginPage.vue b/src/components/LoginPage.vue index 8e6a7e9..e8abab9 100644 --- a/src/components/LoginPage.vue +++ b/src/components/LoginPage.vue @@ -37,22 +37,9 @@ - +
-
    -
  • - -
  • -
+

This environment is configured without multi-tenancy enabled.

@@ -60,9 +47,7 @@