Skip to content

Conversation

@ap-1
Copy link
Contributor

@ap-1 ap-1 commented May 20, 2025

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2025 18:16
@vercel
Copy link

vercel bot commented May 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 20, 2025 6:16pm

@ap-1 ap-1 merged commit b2b3378 into main May 20, 2025
5 of 6 checks passed
Copy link

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 Clerk authentication configuration by wrapping the Next.js root component with a ClerkProvider and whitelisting specific redirect origins, and introduces the Clerk package dependency.

  • Wraps <Component> in ClerkProvider and sets allowedRedirectOrigins
  • Adds @clerk/nextjs to project dependencies

Reviewed Changes

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

File Description
src/pages/_app.tsx Wraps the app in ClerkProvider with allowed redirect origins
package.json Adds new dependency @clerk/nextjs@^6.19.5
Comments suppressed due to low confidence (2)

src/pages/_app.tsx:9

  • [nitpick] You can combine multiple icons in a single call (e.g. library.add(faBars, faCircle, faCircleHollow)) to reduce repetitive invocations.
library.add(faBars);

src/pages/_app.tsx:14

  • Introducing ClerkProvider with custom redirect origins adds new auth flow behavior; consider adding integration or CI tests to verify correct redirect handling.
<ClerkProvider

Comment on lines +15 to +18
allowedRedirectOrigins={[
'https://www.cmucourses.com',
'https://cmucourses.com',
]}
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

Hardcoding redirect origins can make updates error-prone; consider extracting these URLs into environment variables or a configuration constant.

Suggested change
allowedRedirectOrigins={[
'https://www.cmucourses.com',
'https://cmucourses.com',
]}
allowedRedirectOrigins={
process.env.NEXT_PUBLIC_ALLOWED_REDIRECT_ORIGINS
? process.env.NEXT_PUBLIC_ALLOWED_REDIRECT_ORIGINS.split(',')
: []
}

Copilot uses AI. Check for mistakes.
Comment on lines 8 to +19
function MyApp({ Component, pageProps }: AppProps) {
library.add(faBars);
library.add(faCircle);
library.add(faCircleHollow);
return <Component suppressHydrationWarning {...pageProps} />;

return (
<ClerkProvider
allowedRedirectOrigins={[
'https://www.cmucourses.com',
'https://cmucourses.com',
]}
>
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

The array for allowedRedirectOrigins is recreated on every render, which may trigger unnecessary re-renders; consider defining it outside the component scope.

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