Skip to content

Conversation

@Pwuts
Copy link
Member

@Pwuts Pwuts commented Oct 28, 2025

The frontend .env.default is incomplete and has a strange format. Small effort to fix.

Changes πŸ—οΈ

  • Fix indent of frontend/.env.default
  • Add comments explaining config things
  • Add missing env config keys AUTH_CALLBACK_URL, NEXT_PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY

Checklist πŸ“‹

For configuration changes:

  • .env.default is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)

@Pwuts Pwuts requested a review from a team as a code owner October 28, 2025 15:18
@Pwuts Pwuts requested review from 0ubbe and Swiftyos and removed request for a team October 28, 2025 15:18
@github-project-automation github-project-automation bot moved this to πŸ†• Needs initial review in AutoGPT development kanban Oct 28, 2025
@netlify
Copy link

netlify bot commented Oct 28, 2025

βœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
πŸ”¨ Latest commit 2d3a5df
πŸ” Latest deploy log https://app.netlify.com/projects/auto-gpt-docs-dev/deploys/6900ded0d5bdc8000807be4e

@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label Oct 28, 2025
@netlify
Copy link

netlify bot commented Oct 28, 2025

βœ… Deploy Preview for auto-gpt-docs canceled.

Name Link
πŸ”¨ Latest commit 2d3a5df
πŸ” Latest deploy log https://app.netlify.com/projects/auto-gpt-docs/deploys/6900ded0b5a0f50008d1d375

@coderabbitai
Copy link

coderabbitai bot commented Oct 28, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

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.

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

✨ Finishing touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pwuts/fix-frontend-default-env

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.

@deepsource-io
Copy link

deepsource-io bot commented Oct 28, 2025

Here's the code health analysis summary for commits 59657eb..2d3a5df. View details on DeepSourceΒ β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScriptβœ…Β SuccessView CheckΒ β†—
DeepSource Python LogoPythonβœ…Β SuccessView CheckΒ β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.

@Pwuts Pwuts changed the title dx(frontend): Fix .env.default dx(frontend): Update .env.default Oct 28, 2025
NEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8006/api
NEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/ws
NEXT_PUBLIC_FRONTEND_BASE_URL=http://localhost:3000
AUTH_CALLBACK_URL="${NEXT_PUBLIC_FRONTEND_BASE_URL}/auth/callback"
Copy link

Choose a reason for hiding this comment

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

Bug: AUTH_CALLBACK_URL in .env.default uses unsupported variable expansion, resulting in an invalid literal string for OAuth callbacks.
Severity: HIGH | Confidence: 0.95

πŸ” Detailed Analysis

The AUTH_CALLBACK_URL in .env.default is defined with variable syntax like ${NEXT_PUBLIC_FRONTEND_BASE_URL}/auth/callback. The dotenv library (v17.2.1) and current Next.js configuration do not support shell-style variable expansion. Consequently, AUTH_CALLBACK_URL is set to the literal string "${NEXT_PUBLIC_FRONTEND_BASE_URL}/auth/callback". This invalid URL is then used for OAuth redirects, causing authentication failures in local development environments. The fallback http://localhost:3000/auth/callback is not utilized because AUTH_CALLBACK_URL is technically defined.

πŸ’‘ Suggested Fix

Either hardcode AUTH_CALLBACK_URL to http://localhost:3000/auth/callback in .env.default or implement dotenv variable expansion support (e.g., via dotenv-expand or @next/env configuration).

πŸ€– Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: autogpt_platform/frontend/.env.default#L4

Potential issue: The `AUTH_CALLBACK_URL` in `.env.default` is defined with variable
syntax like `${NEXT_PUBLIC_FRONTEND_BASE_URL}/auth/callback`. The `dotenv` library
(v17.2.1) and current Next.js configuration do not support shell-style variable
expansion. Consequently, `AUTH_CALLBACK_URL` is set to the literal string
`"${NEXT_PUBLIC_FRONTEND_BASE_URL}/auth/callback"`. This invalid URL is then used for
OAuth redirects, causing authentication failures in local development environments. The
fallback `http://localhost:3000/auth/callback` is not utilized because
`AUTH_CALLBACK_URL` is technically defined.

Did we get this right? πŸ‘ / πŸ‘Ž to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX platform/frontend AutoGPT Platform - Front end size/m

Projects

Status: πŸ†• Needs initial review
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants