Skip to content

Frontend auth#11

Merged
morshedalamdev merged 7 commits intomainfrom
frontend-auth
Mar 7, 2026
Merged

Frontend auth#11
morshedalamdev merged 7 commits intomainfrom
frontend-auth

Conversation

@morshedalamdev
Copy link
Owner

This pull request updates several Next.js build and manifest files, primarily to reflect changes in how application and authentication routes are organized and to update internal build artifacts. The updates ensure that the build output and server manifests are consistent with recent routing and code changes, particularly around authentication pages and internal chunk references.

Key changes include:

Routing and Manifest Updates:

  • Updated app-paths-manifest.json to move authentication routes (/login and /signup) under the new /(auth)/ namespace, and removed legacy route entries, ensuring the manifest matches the new routing structure.

Build Artifacts and Chunk References:

  • Updated build-manifest.json and fallback-build-manifest.json to include new and updated JavaScript chunk references for the /_app and /_error pages, reflecting changes in the build output. [1] [2]
  • Changed a server chunk reference in app/(root)/page.js to point to a new [root-of-the-server] chunk, likely due to a rebuild or code update.

Preview Mode Security:

  • Rotated the preview mode ID, signing key, and encryption key in prerender-manifest.json, which is a routine security and consistency update for Next.js preview mode.

Modify app pages and client components: client/app/(root)/page.tsx, client/app/(root)/user/[id]/page.tsx, and components/comment/comment-dialog.tsx, components/post/post-create.tsx, components/post/post-edit.tsx, components/ui/field.tsx, components/user/user-dialog.tsx. Development build artifacts and turbopack cache/logs were regenerated (.next dev cache and static chunk files updated). These changes include UI and page logic updates and the corresponding dev build outputs.
Introduce client-side auth utilities and UI helper: add use-show-toast hook, token helper and shared types, plus auth-store and user-store. Update client layout and package.json; rebuild outputs updated (.next dev cache and static chunks). Server build artifacts and server/src/main.ts were also updated as part of the rebuild.
Introduce a new generic useFetcher hook that wraps axios for making API calls. The hook builds requests with a BASE_URL (from NEXT_PUBLIC_API_BASE_URL or localhost fallback), JSON headers, optional Authorization using getAccessToken, and supports method, payload (data) and params. Responses are normalized to a FetcherResponse<{T}> shape ({ success, message, data }) and Axios errors are handled to return a readable message instead of throwing.
Introduce server-side auth actions (client/actions/auth.ts) for signup and login with validation and fetcher integration. Convert login and signup forms to client components using useActionState, show validation errors, preserve input values, show toasts, and handle pending state (Spinner). Add a Sonner-based Toaster component and a Spinner icon component. Also rename auth page paths to the (auth) group and update login/signup links.
Add the /(root)/page entry to the app paths manifest and update the client-side RSC reference manifest to include the root page mappings. The change also includes regenerated dev build artifacts (turbopack cache/LOG and RSC/client manifests) as part of the dev rebuild.
Introduce client/lib/token-validator.ts and update client auth code to use token validation. Adjustments made to actions/auth.ts, hooks/use-fetcher.ts and client/lib/token.ts to integrate validation and improve auth handling. Update package.json and lockfile (dependency/version changes) and propagate auth config changes to server src and compiled dist files. Also includes regenerated Next.js/Turbopack build cache files.
Add client middleware and refine authentication flow: update auth actions (client/actions/auth.ts), login and signup components (client/components/auth/*), header, token utilities, and shared types. Regenerated Next.js dev build artifacts and turbopack cache/manifest files as part of the build; updated server tsbuild info.
@morshedalamdev morshedalamdev merged commit badc100 into main Mar 7, 2026
1 check passed
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