feat: add auto-login for dev mode and fix log box formatting#567
Conversation
Add AUTOMAKER_AUTO_LOGIN environment variable that, when set to 'true', automatically creates a session for web mode users without requiring them to enter the API key. Useful for development environments. Also fix formatting issues in console log boxes: - API Key box: add right border, show auto-login status and tips - Claude auth warning: add separator line, fix emoji spacing - Server info box: use consistent 71-char width, proper padding - Port conflict error: use same width, proper dynamic padding Environment variables: - AUTOMAKER_AUTO_LOGIN=true: Skip login prompt, auto-create session - AUTOMAKER_API_KEY: Use a fixed API key (existing) - AUTOMAKER_HIDE_API_KEY=true: Hide the API key banner (existing)
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (5)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 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 |
Summary of ChangesHello @stefandevo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on enhancing the developer experience and improving the clarity of server-side console output. It introduces a convenient auto-login mechanism for development environments, significantly reducing friction during frequent testing. Concurrently, it refines the visual presentation of critical server information and warnings in the console, making them more structured and easier to read. Additionally, a minor adjustment to UI test IDs ensures better maintainability for front-end testing. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a convenient auto-login feature for development and improves the formatting of console log messages. The implementation of the auto-login is sound, but it introduces a critical security vulnerability if accidentally enabled in production, which my review addresses. I've also identified a potential issue with non-unique test IDs in the UI component changes that could lead to flaky tests. Additionally, there are some minor maintainability improvements suggested for the logging changes to reduce magic numbers and improve code clarity. Overall, the changes are good, but the security and test-related feedback should be addressed.
9efa717 to
7fbc7b0
Compare
- Add NODE_ENV !== 'production' check to prevent auto-login in production - Extract magic number 67 to BOX_CONTENT_WIDTH constant in auth.ts and index.ts - Document AUTOMAKER_AUTO_LOGIN env var in CLAUDE.md and README.md
Summary
AUTOMAKER_AUTO_LOGINenvironment variable that, when set totrue, automatically creates a session for web mode users without requiring them to enter the API keyNODE_ENV !== 'production'to prevent accidental use in production environments67toBOX_CONTENT_WIDTHconstant for maintainabilityChanges
Auto-login feature (
apps/server/src/routes/auth/index.ts)/api/auth/statusendpoint to automatically create a session cookie whenAUTOMAKER_AUTO_LOGIN=trueLog box formatting (
apps/server/src/lib/auth.ts,apps/server/src/index.ts)BOX_CONTENT_WIDTH = 67constant for all log box paddingDocumentation
AUTOMAKER_AUTO_LOGINtoCLAUDE.mdandREADME.mdEnvironment Variables
AUTOMAKER_AUTO_LOGIN=trueAUTOMAKER_API_KEYAUTOMAKER_HIDE_API_KEY=trueTest Plan
AUTOMAKER_AUTO_LOGIN=trueand verify no login prompt appearsAUTOMAKER_AUTO_LOGIN=truewithNODE_ENV=productionand verify login is still required