Skip to content

Add login page - #4706

Draft
patrick91 wants to merge 1 commit into
2026-08-06-add-shadcnfrom
2026-08-06-add-login-page
Draft

Add login page#4706
patrick91 wants to merge 1 commit into
2026-08-06-add-shadcnfrom
2026-08-06-add-login-page

Conversation

@patrick91

Copy link
Copy Markdown
Member

No description provided.

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
pycon Ready Ready Preview Aug 6, 2026 2:03pm

@claude

claude Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Adds a login page for the dashboard app: Django-side login/dashboard views with next redirect validation and login_required, plus React components (login form, user menu, shadcn primitives) that call the existing /graphql login/logout mutations directly via fetch.

Error Handling

  • login-form.tsx: top-level GraphQL errors (payload.errors) are surfaced verbatim as form errors (errors.map((error) => error.message)). Unlike the WrongEmailOrPassword branch, which uses a hardcoded friendly message, this path shows whatever message the server returns for unexpected/unhandled exceptions, which risks leaking internal error details to users.
  • nav-user.tsx logOut(): no error handling — if the fetch throws (network error) or response.ok is false, nothing happens: no loading state, no user feedback, dropdown just closes. The user may believe they logged out when they didn't. Also, it only checks response.ok and ignores GraphQL-level errors in the body, so a 200 response with a failed mutation is still treated as success... actually it doesn't even redirect on error, it silently no-ops.

Minor

  • Both login-form.tsx and nav-user.tsx duplicate near-identical raw fetch("/graphql", ...) boilerplate; consider extracting a small shared GraphQL helper now that there are two call sites.
  • dashboard/login views don't set Cache-Control: no-store. Since Inertia embeds the authenticated user's name/email directly in the rendered HTML response, using the browser back button after logout could show a cached copy of the dashboard page.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.45%. Comparing base (242ebd4) to head (fb57dc6).

Additional details and impacted files
@@                    Coverage Diff                    @@
##           2026-08-06-add-shadcn    #4706      +/-   ##
=========================================================
+ Coverage                  92.44%   92.45%   +0.01%     
=========================================================
  Files                        358      358              
  Lines                      10731    10747      +16     
  Branches                     818      820       +2     
=========================================================
+ Hits                        9920     9936      +16     
  Misses                       698      698              
  Partials                     113      113              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Shortcake-Parent: 2026-08-06-add-shadcn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant