Skip to content

Conversation

@peppescg
Copy link
Collaborator

@peppescg peppescg commented Nov 27, 2025

Replace from NEXT_PUBLIC_OIDC_PROVIDER_ID to OIDC_PROVIDER_ID in this way all the relevant env var are server side and this also enable us to handle all the oidc providers

Screenshot 2025-11-27 at 19 59 23

@peppescg peppescg self-assigned this Nov 27, 2025
Copilot AI review requested due to automatic review settings November 27, 2025 19:00
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

This PR refactors the OIDC provider ID handling by moving it from a client-side environment variable (NEXT_PUBLIC_OIDC_PROVIDER_ID) to a server-side only variable (OIDC_PROVIDER_ID). The SignInButton component is now more generic, accepting providerId as a prop from the server component rather than importing the constant directly.

Key changes:

  • Environment variable renamed from NEXT_PUBLIC_OIDC_PROVIDER_ID to OIDC_PROVIDER_ID (server-side only)
  • SignInButton refactored to accept providerId prop with dynamic provider name capitalization
  • Sign-in page (Server Component) now passes the provider ID to the button component

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vitest.config.mts Updated test environment variable from NEXT_PUBLIC_OIDC_PROVIDER_ID to OIDC_PROVIDER_ID
src/lib/auth/constants.ts Changed constant to read from OIDC_PROVIDER_ID instead of NEXT_PUBLIC_OIDC_PROVIDER_ID, updated documentation to clarify server-side only usage
src/lib/auth/README.md Updated documentation example to use OIDC_PROVIDER_ID
src/app/signin/signin-button.tsx Refactored to accept providerId prop, added dynamic provider name capitalization, removed direct import of constant
src/app/signin/page.tsx Added import of OIDC_PROVIDER_ID constant and passes it to SignInButton component
src/app/signin/__tests__/signin.test.tsx Updated test assertions to expect "Oidc" instead of "Okta", added new test case for Okta provider, consolidated imports
dev-auth/README.md Updated environment variable documentation from NEXT_PUBLIC_OIDC_PROVIDER_ID to OIDC_PROVIDER_ID
README.md Updated all references to use OIDC_PROVIDER_ID, reformatted environment variables table
CLAUDE.md Updated environment variable documentation
AGENTS.md Updated environment variable documentation
.env.example Updated example configuration to use OIDC_PROVIDER_ID

@peppescg peppescg linked an issue Nov 27, 2025 that may be closed by this pull request
@peppescg peppescg merged commit b2f3e36 into main Nov 28, 2025
15 checks 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.

[Task] refactor oidc provider in a generic way

3 participants