-
Notifications
You must be signed in to change notification settings - Fork 46.1k
dx(frontend): Update .env.default #11280
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
base: dev
Are you sure you want to change the base?
Conversation
β Deploy Preview for auto-gpt-docs-dev canceled.
|
β Deploy Preview for auto-gpt-docs canceled.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the β¨ Finishing touchesπ§ͺ Generate unit tests (beta)
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. Comment |
|
Here's the code health analysis summary for commits Analysis Summary
|
| 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" |
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.
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.
The frontend .env.default is incomplete and has a strange format. Small effort to fix.
Changes ποΈ
frontend/.env.defaultAUTH_CALLBACK_URL,NEXT_PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEYChecklist π
For configuration changes:
.env.defaultis updated or already compatible with my changesdocker-compose.ymlis updated or already compatible with my changes