-
Notifications
You must be signed in to change notification settings - Fork 131
fix(fe): use publishable token for integrating next.js with other services #3451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 11-09-fix_rivetkit_remove_incorrect_getendpoint_call_in_metadata_handler
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
More templates
@rivetkit/actor
@rivetkit/cloudflare-workers
@rivetkit/core
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
Code Review: Fix publishable token usage for Next.js integrationsSummaryThis PR correctly switches from using engineAdminTokenQueryOptions() to usePublishableToken() when integrating Next.js with Vercel and Railway. This is an important security improvement that ensures client-side applications receive publishable tokens instead of admin tokens. Positive FindingsSecurity Improvement
Code Quality
Configuration
Issues and Suggestions1. Incomplete biome-ignore comment (Minor)File: frontend/src/app/dialogs/connect-quick-vercel-frame.tsx:1 The ignore comment has a placeholder explanation that should be replaced with the actual reason, similar to connect-vercel-frame.tsx which uses: guarded by build constant Recommendation: Update the comment to match the more descriptive version. 2. Unused imports (Minor)File: frontend/src/app/dialogs/connect-quick-vercel-frame.tsx:24-26 The imports useCloudDataProvider and useCloudNamespaceDataProvider appear unused and should be removed. Recommendation: Remove unused imports to keep the code clean. Test CoverageConcern: No tests were added or modified for these changes. Recommendation: Consider adding tests to verify the correct token type is returned based on APP_TYPE, though given this is primarily a security fix and the lack of existing tests in this directory, manual verification may be sufficient. Security ConsiderationsExcellent security improvement! This change ensures:
Verification needed: Please confirm publishable tokens have been tested in both cloud and engine modes with Vercel/Railway deployments. PerformanceNo performance concerns. The switch to useSuspenseQuery actually improves UX by preventing loading states. Overall AssessmentRecommendation: Approve with minor cleanup This is a valuable security improvement that properly segregates token types. The minor issues are cosmetic and do not block the PR. Action items before merge (optional but recommended):
Great work on identifying and fixing this security issue! |

No description provided.