Adapt latest nextjs & react#23
Merged
Merged
Conversation
Signed-off-by: ByteKatana <19264901+ByteKatana@users.noreply.github.com>
Signed-off-by: ByteKatana <19264901+ByteKatana@users.noreply.github.com>
Signed-off-by: ByteKatana <19264901+ByteKatana@users.noreply.github.com>
Signed-off-by: ByteKatana <19264901+ByteKatana@users.noreply.github.com>
… configuration adjustments
…essResponse`, and `ErrorResponse`
- Added `getSettings` action to fetch permission groups, namespaces, and API keys. - Added `generateApiKeyAction` to handle API key generation. - Added `removeApiKeyAction` to handle API key removal.
- Introduced server action `updatePermissionsAction` for updating permission groups via API.
- Moved `entry-types` page component to `components/pages/entry-types`. - Updated routing to use the new app router
…ypes, permission groups, and users
- Added checks for `permGroupData` and its `privileges` before updating. - Enhanced error handling for cases where permission group updates fail. - Ensured namespace validation when updating entry types.
…er creation responses
…permission groups
… entry types index page
…mission group by slug
- Create new auth.ts configuration with Auth.js v5 patterns - Migrate login to App Router (app/login/page.tsx + LoginForm.tsx) - Add App Router API handler (app/api/auth/[...nextauth]/route.ts) - Implement middleware for /dashboard/* route protection - Create server-side session helpers (lib/auth/get-session.ts) - Add sign-out server actions with multiple variants - Update type definitions for Auth.js v5 - Preserve custom session fields (permission_group) - Maintain JWT strategy with MongoDB Credentials provider - Add comprehensive test suite (60+ test cases): - Unit tests for auth configuration - Integration tests for API routes - E2E tests for complete auth flow - Update Cypress tests for new cookie name (authjs.session-token) - Clean up deprecated NextResponse imports - Remove dead getServerSideProps from client components - Fix Tailwind config to include /app directory - Enable TypeScript strict mode - Add complete migration plan and checklist Breaking Changes: - Session cookie renamed: next-auth.session-token → authjs.session-token - All users will be logged out on deployment - next-auth package updated from v4.20.1 to v5.0.0-beta.30
…rated to App Router)
- Add Auth.js v5 middleware proxy for protecting dashboard and API routes - Enforce authentication and group-based access control for sensitive paths - Redirect unauthorized users to login or dashboard pages
…nd include configurations
…(nextjs 16 & react 19)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR focuses on (#16 ) upgrading the core technology stack and migrating the dashboard from the Pages Router to the App Router. It also includes a significant upgrade of authentication logic from
next-authv4 to v5 (Auth.js) and the introduction of Server Actions to replace legacy API calls.🔄 Key Changes
🏗 Framework & Library Upgrades
mongodb,bcryptjs, and testing libraries to ensure compatibility with React 19.tsconfig.jsonwith stricter type checks and modern JSX transforms (react-jsx). Added import aliases for cleaner path management.🗺 App Router Migration
pagesdirectory to theappdirectory.layout.tsxandpage.tsxstructure for the dashboard.generateMetadataand static metadata exports.🔐 Authentication (Auth.js v5)
next-authv4 to v5 (Auth.js).auth.tsand App Router-compatible route handlers (app/api/auth/[...nextauth]/route.ts).LoginFormcomponent⚡ Server Actions & Data Fetching
axiosAPI calls in components with reusable Server Actions located inlib/actions.ActionResponse,SuccessResponse, andErrorResponsetypes.🧪 Testing & QA
🧹 Refactoring & Cleanup
middleware.tsto a customproxy.tsimplementation.