-
Notifications
You must be signed in to change notification settings - Fork 0
feat: handle providerId in a generic way #109
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
Conversation
There was a problem hiding this 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_IDtoOIDC_PROVIDER_ID(server-side only) SignInButtonrefactored to acceptproviderIdprop 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 |
Replace from
NEXT_PUBLIC_OIDC_PROVIDER_IDtoOIDC_PROVIDER_IDin this way all the relevant env var are server side and this also enable us to handle all the oidc providers