Skip to content

Fix frontend login to use /auth/login#31

Merged
gitgrahamdunn merged 1 commit intomainfrom
codex/fix-frontend-login-to-use-/auth/login
Feb 18, 2026
Merged

Fix frontend login to use /auth/login#31
gitgrahamdunn merged 1 commit intomainfrom
codex/fix-frontend-login-to-use-/auth/login

Conversation

@gitgrahamdunn
Copy link
Copy Markdown
Owner

Motivation

  • The sign-in flow was not surfacing errors and could fail silently due to incorrect base URL handling and missing network error handling.
  • The app must use the configured API base URL from import.meta.env.VITE_API_URL and call the backend POST /auth/login endpoint exactly.

Description

  • Normalize VITE_API_URL (strip trailing slash) and ensure API_BASE_URL is used to build requests so calls resolve to ${API_BASE_URL}/auth/login with no hardcoded /api prefix.
  • Add network/fetch failure handling to request and requestForm so failed fetches log a structured console error and throw a clear message Network request failed. Check your connection and API URL..
  • Keep the login endpoint as POST /auth/login and preserve token handling (the app still calls setToken(result.access_token) and the existing localStorage flow remains unchanged).
  • Improve login UX in App.tsx by clearing stale errors on submit, logging auth failures to console, showing an inline error banner on the login form, disabling the submit button while in-flight, and showing Signing in... during submission.

Testing

  • Built the frontend with npm run build and the build succeeded.
  • Launched the dev server with npm run dev -- --host 0.0.0.0 --port 4173 and manually exercised the login form to verify disabled button and error display.
  • Ran a Playwright script against http://127.0.0.1:4173/ to capture the updated login form screenshot (artifact produced).
  • No frontend unit tests were added because the repository has no frontend test runner configured; build and manual/Playwright checks were used to validate the change.

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gitplant Ready Ready Preview, Comment Feb 18, 2026 11:38pm
gitplant-backend Ready Ready Preview, Comment Feb 18, 2026 11:38pm
gitplant-oggy Ready Ready Preview, Comment Feb 18, 2026 11:38pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant