Skip to content

verification page and updated packages#172

Merged
djdiptayan1 merged 2 commits intoreleasefrom
staging
Apr 5, 2026
Merged

verification page and updated packages#172
djdiptayan1 merged 2 commits intoreleasefrom
staging

Conversation

@djdiptayan1
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 5, 2026 07:34
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
githubsrmv2 Ready Ready Preview, Comment Apr 5, 2026 7:35am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fdb3b4b1-7210-40b9-abd8-88249d8d9148

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staging

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@djdiptayan1 djdiptayan1 merged commit f44de49 into release Apr 5, 2026
9 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a certificate verification feature to the Next.js app, including new routes and UI to validate certificate authenticity via the backend API, plus a small dependency update.

Changes:

  • Added /verify and /verify/[id] pages that render a new VerifyPage component and support verifying by URL parameter.
  • Introduced a new API endpoint helper for certificate verification (API_ENDPOINTS.CERTIFICATES.VERIFY).
  • Updated sitemap entries to include /verify and refreshed lastmod timestamps; bumped @vercel/analytics version.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utils/config.js Adds CERTIFICATES.VERIFY endpoint builder used by the new verification UI.
public/sitemap-0.xml Adds /verify to the sitemap and updates lastmod timestamps.
pages/verify/[id].js New SSR route that passes certificateId into the verification UI.
pages/verify.js New base verification route (manual entry flow).
package.json Updates @vercel/analytics dependency version.
components/Verify/VerifyPage.jsx Implements the verification UI and client-side fetch to the verify endpoint.

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

Comment on lines +154 to +166
const handleSubmit = async (event) => {
event.preventDefault();

const trimmed = queryId.trim();
if (!trimmed) {
return;
}

await router.push(`/verify/${encodeURIComponent(trimmed)}`, undefined, {
shallow: true,
});
await verifyCertificate(trimmed);
};
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

handleSubmit calls router.push and then immediately calls verifyCertificate. Since a route change to /verify/[id] (or a param change on the same page) will also trigger the effect that calls verifyCertificate, this can result in duplicate verification requests and UI flicker. Consider making the URL change the single source of truth (push only, let the effect run the verification), and note that shallow: true won’t apply when navigating between different pages (/verify -> /verify/[id]).

Copilot uses AI. Check for mistakes.
Comment on lines +177 to +183
useEffect(() => {
const routeId = initialCertificateId || router.query.id;
if (typeof routeId === "string" && routeId.trim()) {
setQueryId(routeId);
verifyCertificate(routeId);
}
}, [initialCertificateId, router.query.id]);
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

The useEffect that auto-verifies depends on both initialCertificateId and router.query.id, but it always prefers initialCertificateId via initialCertificateId || router.query.id. On the /verify/[id] page, router.query.id typically becomes available after hydration, so this effect can run twice and re-verify the same ID. A common fix is to gate on router.isReady and/or track the last verified ID in a ref so you only call verifyCertificate when the effective ID actually changes.

Copilot uses AI. Check for mistakes.
Comment on lines +177 to +183
useEffect(() => {
const routeId = initialCertificateId || router.query.id;
if (typeof routeId === "string" && routeId.trim()) {
setQueryId(routeId);
verifyCertificate(routeId);
}
}, [initialCertificateId, router.query.id]);
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

Hook linting: verifyCertificate is referenced inside this useEffect, but it isn’t listed in the dependency array, which will trigger react-hooks/exhaustive-deps under next lint. Consider wrapping verifyCertificate in useCallback (with stable deps) and adding it to the dependency list, or moving the verification logic into the effect so the deps are correct.

Copilot uses AI. Check for mistakes.
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.

2 participants