Skip to content

revert(auth,db): rollback oauth/db env changes to restore auth flow#311

Merged
ViktorSvertoka merged 1 commit into
developfrom
fix/auth
Feb 11, 2026
Merged

revert(auth,db): rollback oauth/db env changes to restore auth flow#311
ViktorSvertoka merged 1 commit into
developfrom
fix/auth

Conversation

@ViktorSvertoka
Copy link
Copy Markdown
Member

@ViktorSvertoka ViktorSvertoka commented Feb 11, 2026

Summary by CodeRabbit

  • Refactor
    • Enhanced database configuration handling with improved error detection for missing credentials
    • Streamlined OAuth authentication provider configuration structure

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 11, 2026

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

Project Deployment Actions Updated (UTC)
devlovers-net Ready Ready Preview, Comment Feb 11, 2026 10:17pm

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 11, 2026

Deploy Preview for develop-devlovers ready!

Name Link
🔨 Latest commit eed6beb
🔍 Latest deploy log https://app.netlify.com/projects/develop-devlovers/deploys/698cffc8a28e73000836518f
😎 Deploy Preview https://deploy-preview-311--develop-devlovers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

Database and OAuth configuration files are refactored to eliminate dynamic getters, type aliases, and fallback mechanisms. The changes replace conditional getters with direct object literals, enforce explicit error handling for missing environment variables, and simplify configuration initialization logic.

Changes

Cohort / File(s) Summary
Database Configuration
frontend/db/index.ts
Simplified dotenv initialization; replaced dual DATABASE_URL fallback with exclusive use of DATABASE_URL_LOCAL for local environments; removed proxy-based fallback logic and added explicit error throws for missing configuration.
OAuth Configuration
frontend/lib/env/auth.ts
Removed OAuthProviderEnv type alias; converted google and github property getters to direct object literals and conditional expressions, eliminating nested getter abstractions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • AM1007

Poem

🐰 Configuration untangled with a hop and a bound,
No more getters, just objects—cleaner ground!
Error paths explicit, no proxies to hide,
The code hops cleaner with straightforward pride. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title uses 'revert' but the changes show active refactoring (removing getters, inlining types, restructuring config flow) rather than reverting to a previous state. The title is misleading about the nature of the changes. Update the title to accurately reflect the changes, such as 'refactor(auth,db): simplify environment configuration and remove dynamic fallbacks' to better represent the actual modifications made.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/auth

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
frontend/lib/env/auth.ts (1)

40-57: Consider a lookup map to reduce ternary nesting (optional).

The nested ternary works correctly but could be slightly cleaner with a map-based approach, especially if more environments are added later. That said, for a revert PR with only three environments, this is perfectly fine as-is.

♻️ Optional refactor
-  github:
-    APP_ENV === 'local'
-      ? {
-          clientId: requireEnv('GITHUB_CLIENT_ID_LOCAL'),
-          clientSecret: requireEnv('GITHUB_CLIENT_SECRET_LOCAL'),
-          redirectUri: requireEnv('GITHUB_CLIENT_REDIRECT_URI_LOCAL'),
-        }
-      : APP_ENV === 'develop'
-        ? {
-            clientId: requireEnv('GITHUB_CLIENT_ID_DEVELOP'),
-            clientSecret: requireEnv('GITHUB_CLIENT_SECRET_DEVELOP'),
-            redirectUri: requireEnv('GITHUB_CLIENT_REDIRECT_URI_DEVELOP'),
-          }
-        : {
-            clientId: requireEnv('GITHUB_CLIENT_ID_PROD'),
-            clientSecret: requireEnv('GITHUB_CLIENT_SECRET_PROD'),
-            redirectUri: requireEnv('GITHUB_CLIENT_REDIRECT_URI_PROD'),
-          },
+  github: (() => {
+    const suffix = APP_ENV === 'local' ? 'LOCAL' : APP_ENV === 'develop' ? 'DEVELOP' : 'PROD';
+    return {
+      clientId: requireEnv(`GITHUB_CLIENT_ID_${suffix}`),
+      clientSecret: requireEnv(`GITHUB_CLIENT_SECRET_${suffix}`),
+      redirectUri: requireEnv(`GITHUB_CLIENT_REDIRECT_URI_${suffix}`),
+    };
+  })(),

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.

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.

1 participant