Skip to content

Enable Next.js to execute auth middleware by adding src/middleware.ts entrypoint - #2

Merged
kota6-me merged 2 commits into
claude/repo-contents-check-7Bmhrfrom
copilot/fix-review-comment-3345263220
Jun 3, 2026
Merged

Enable Next.js to execute auth middleware by adding src/middleware.ts entrypoint#2
kota6-me merged 2 commits into
claude/repo-contents-check-7Bmhrfrom
copilot/fix-review-comment-3345263220

Conversation

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

The unresolved review comment identified that authentication middleware was never executed because the implementation lived in src/proxy.ts, which Next.js does not treat as middleware. This PR wires the existing logic into the framework-recognized middleware entrypoint without changing behavior inside the auth flow.

  • Problem addressed

    • Next.js only loads middleware from middleware.ts or src/middleware.ts; src/proxy.ts was ignored, so config.matcher and auth redirects were effectively inactive.
  • Minimal fix

    • Added src/middleware.ts to re-export the existing middleware function and matcher config from src/proxy.ts.
    • No logic changes were made to route matching, Supabase auth checks, or redirect rules.
  • Implementation

    // src/middleware.ts
    export { proxy as middleware, config } from "./proxy";

@kota6-me
kota6-me marked this pull request as ready for review June 3, 2026 00:45
Copilot AI review requested due to automatic review settings June 3, 2026 00:45
Copilot AI changed the title [WIP] Fix the code based on review comment 3345263220 Enable Next.js to execute auth middleware by adding src/middleware.ts entrypoint Jun 3, 2026
Copilot AI requested a review from kota6-me June 3, 2026 00:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR wires Next.js’ middleware entrypoint (src/middleware.ts) to the existing auth-aware proxy logic so that the authentication/redirect behavior implemented in src/proxy.ts actually executes at runtime.

Changes:

  • Add src/middleware.ts that re-exports proxy as the Next.js middleware function.
  • Re-export the existing config.matcher so route matching continues to be controlled from the proxy module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kota6-me
kota6-me merged commit d442fe2 into claude/repo-contents-check-7Bmhr Jun 3, 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.

3 participants