Fix nextjs quickstart middleware pattern to use asgardeoMiddleware#456
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughUpdated Next.js Quickstart docs to replace manual Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/nextjs/QUICKSTART.md`:
- Around line 214-219: The documentation example passes the configuration object
as the first argument to asgardeoMiddleware, but the function signature expects
an optional handler as the first parameter and options as the second; update the
example so the options object (containing signInUrl) is provided as the second
argument to asgardeoMiddleware, e.g. call asgardeoMiddleware with undefined for
the handler when you only need options, or pass your handler function first and
the options object second (references: asgardeoMiddleware, handler, options,
signInUrl).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1d9805a2-85aa-4976-b4b3-d7219e04cf86
📒 Files selected for processing (1)
packages/nextjs/QUICKSTART.md
Purpose
The QUICKSTART.md was using outdated API patterns (
new AsgardeoNext()with.middleware()method) that don't match the current SDK implementation. This could confuse developers following the guide, as the code wouldn't work.Updated to use the correct
asgardeoMiddlewarefunction exported from@asgardeo/nextjs/server, which aligns with the official Asgardeo documentation.Related Issues
Related PRs
Checklist
Security checks
Summary by CodeRabbit