Skip to content

Feat/issue 31 sign in - #46

Merged
VidurShah merged 6 commits into
mainfrom
feat/issue-31-sign-in
Nov 30, 2026
Merged

VidurShah merged 6 commits into
mainfrom
feat/issue-31-sign-in

Conversation

@HarshaMatta

Copy link
Copy Markdown
Collaborator

Closes #31

Summary

Implements the Sign-in UI for the CSSG Internal Tool using the existing Better Auth backend.

What changed

  • Added /sign-in with email/password authentication, generic credential errors, and loading states.
  • Added safe redirect validation to prevent external redirects and preserve the user's intended destination.
  • Added Next.js 16 route protection through src/proxy.ts, keeping public check-in and authentication pages accessible.
  • Added an authenticated user header using GET /api/v1/me, with sign-out functionality and failure handling.
  • Added /set-password for invite/reset tokens, password confirmation, and invalid-token handling.
  • Added unit and component tests covering authentication behavior, redirects, session state, and error handling.

Verification

  • Local formatting, linting, typechecking, tests, and production build reported passing.
  • Added regression tests for failed sign-out, expired-session redirects, stale session state, and malformed redirect destinations.
  • Updated bun.lock to include the frontend testing dependencies.
  • GitHub CI and real-browser authentication flows still require final verification.

Known limitations

  • The Next.js proxy is a navigation guard; backend API authorization remains independently enforced where implemented.
  • Forgot-password email delivery, invite/reset-token issuance, role-based landing pages, and final UI designs are outside this ticket.
  • Complete reset-token redemption has not been independently verified.

Checklist

  • Feature implementation committed
  • Unit and component regression tests added
  • Dependency lockfile updated
  • GitHub CI passes
  • Manual browser verification
  • Reviewer approval

@VidurShah

Copy link
Copy Markdown
Collaborator

Rebased onto main (0f74c92) so this can merge. Conflict resolutions:

  • packages/shared/src/index.ts: kept main's members/projects exports and this branch's redirect export.
  • apps/web/tests/setup.ts: kept main's Turnstile cleanup in afterEach.
  • apps/web/package.json: kept main's typecheck script (also checks tests/).
  • bun.lock: regenerated with bun install, not hand-merged.

Locally, lint:all, typecheck:all and test:all pass (API 365/365, web 115/115). No code changes beyond the conflict resolutions.

@VidurShah
VidurShah force-pushed the feat/issue-31-sign-in branch from 631ece5 to 4a09ac9 Compare November 30, 2026 17:20
@VidurShah VidurShah mentioned this pull request Nov 30, 2026
3 tasks done
@VidurShah
VidurShah merged commit 5643257 into main Nov 30, 2026
1 check passed
@VidurShah
VidurShah deleted the feat/issue-31-sign-in branch November 30, 2026 21:40
@VidurShah
VidurShah restored the feat/issue-31-sign-in branch November 30, 2026 21:41
@VidurShah
VidurShah deleted the feat/issue-31-sign-in branch November 30, 2026 21:42
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.

Sign-in UI

2 participants