Skip to content

feat: add auto-login for dev mode and fix log box formatting#567

Merged
stefandevo merged 3 commits intoAutoMaker-Org:v0.13.0rcfrom
stefandevo:feature/auto-login-dev-mode
Jan 18, 2026
Merged

feat: add auto-login for dev mode and fix log box formatting#567
stefandevo merged 3 commits intoAutoMaker-Org:v0.13.0rcfrom
stefandevo:feature/auto-login-dev-mode

Conversation

@stefandevo
Copy link
Copy Markdown
Collaborator

@stefandevo stefandevo commented Jan 18, 2026

Summary

  • 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
  • Security safeguard: Auto-login only works when NODE_ENV !== 'production' to prevent accidental use in production environments
  • Fix formatting issues in console log boxes (proper padding and alignment)
  • Extract magic number 67 to BOX_CONTENT_WIDTH constant for maintainability

Changes

Auto-login feature (apps/server/src/routes/auth/index.ts)

  • Modified /api/auth/status endpoint to automatically create a session cookie when AUTOMAKER_AUTO_LOGIN=true
  • Added production environment check to prevent auto-login in production
  • Useful for development environments where entering the API key on every refresh is tedious

Log box formatting (apps/server/src/lib/auth.ts, apps/server/src/index.ts)

  • Extracted BOX_CONTENT_WIDTH = 67 constant for all log box padding
  • Fixed border alignment issues in API key box, Claude warning box, server info box, and port error box
  • Added auto-login status display to API key box
  • Added tips section showing available environment variables

Documentation

  • Added AUTOMAKER_AUTO_LOGIN to CLAUDE.md and README.md

Environment Variables

Variable Description
AUTOMAKER_AUTO_LOGIN=true Skip login prompt, auto-create session (dev only, ignored when NODE_ENV=production)
AUTOMAKER_API_KEY Use a fixed API key (existing)
AUTOMAKER_HIDE_API_KEY=true Hide the API key banner (existing)

Test Plan

  • Set AUTOMAKER_AUTO_LOGIN=true and verify no login prompt appears
  • Set AUTOMAKER_AUTO_LOGIN=true with NODE_ENV=production and verify login is still required
  • Verify log boxes display with correct alignment in terminal
  • Verify existing auth flows still work (API key entry, Electron mode)

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)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 18, 2026

Warning

Rate limit exceeded

@stefandevo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 0c053da and 00df741.

📒 Files selected for processing (5)
  • CLAUDE.md
  • README.md
  • apps/server/src/index.ts
  • apps/server/src/lib/auth.ts
  • apps/server/src/routes/auth/index.ts

Note

Other AI code review bot(s) detected

CodeRabbit 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Auto-login for Development: Introduced an AUTOMAKER_AUTO_LOGIN environment variable that, when set to true, automatically creates a session for web mode users, bypassing the need to enter an API key during development.
  • Improved Console Log Box Formatting: Addressed and fixed various formatting and alignment issues across several console log boxes, including the Claude warning, server information, port error, and API key display boxes, enhancing readability and visual consistency.
  • Enhanced API Key Display: The API key console output now includes the status of the AUTOMAKER_AUTO_LOGIN feature and a new 'Tips' section detailing relevant environment variables for easier configuration.
  • UI Test ID Refinement: Updated the data-testid attribute for project switcher items in the UI to use a sanitized version of the project name, improving consistency and robustness for automated testing.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread apps/server/src/routes/auth/index.ts Outdated
Comment thread apps/server/src/index.ts Outdated
Comment thread apps/server/src/lib/auth.ts Outdated
@stefandevo stefandevo force-pushed the feature/auto-login-dev-mode branch from 9efa717 to 7fbc7b0 Compare January 18, 2026 13:51
- 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
@stefandevo stefandevo merged commit 55a34a9 into AutoMaker-Org:v0.13.0rc Jan 18, 2026
6 checks passed
@stefandevo stefandevo deleted the feature/auto-login-dev-mode branch January 20, 2026 08:09
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