Skip to content

fix: add API key header to verifySession for Electron auth#383

Merged
Shironex merged 1 commit intov0.9.0rcfrom
fix/electron-initial-auth
Jan 8, 2026
Merged

fix: add API key header to verifySession for Electron auth#383
Shironex merged 1 commit intov0.9.0rcfrom
fix/electron-initial-auth

Conversation

@Shironex
Copy link
Copy Markdown
Collaborator

@Shironex Shironex commented Jan 8, 2026

Summary

  • Fix Electron mode showing "You've been logged out" screen on startup
  • Add missing X-API-Key header to verifySession() function
  • The function only included session token (web mode) but not API key (Electron mode)

Root Cause

The verifySession() function in http-api-client.ts was not including the X-API-Key header when checking authentication status. In Electron mode, authentication uses API key headers, not session cookies. This caused /api/settings/status to return 401, triggering the logged-out screen.

Test plan

  • Launch Electron app - should go directly to main UI without login prompt
  • Verify web mode still works with session-based auth

🤖 Generated with Claude Code

The verifySession() function was not including the X-API-Key header
when making requests to /api/settings/status, causing Electron mode
to fail authentication on app startup despite having a valid API key.

This resulted in users seeing "You've been logged out" screen
immediately after launching the Electron app.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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.


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 @Shironex, 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 addresses a critical authentication bug in the Electron application mode. By ensuring the verifySession function correctly includes the X-API-Key header, it resolves the problem of users being incorrectly prompted with a 'logged out' message upon launching the Electron app, thereby improving the initial user experience and application stability for Electron users.

Highlights

  • Electron Authentication Fix: Resolves the issue where the Electron application would display a 'You've been logged out' screen upon startup, improving the initial user experience.
  • API Key Header Addition: The verifySession() function now correctly includes the X-API-Key header, which is essential for authentication in Electron mode.
  • Unified Authentication Logic: The verifySession() function has been updated to properly handle both API key-based authentication for Electron and session token-based authentication for web mode.

🧠 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 correctly adds the X-API-Key header to the verifySession function, fixing an authentication issue in Electron mode. The change is straightforward and addresses the root cause. I've added one suggestion to make the authentication header logic more robust and consistent with other parts of the codebase by ensuring that only one authentication token is sent per request.

@Shironex Shironex self-assigned this Jan 8, 2026
@Shironex Shironex added Work-In-Progress Currently being addressed. Do Not Merge Use this label if something should not be merged. labels Jan 8, 2026
@Shironex Shironex merged commit f304119 into v0.9.0rc Jan 8, 2026
6 of 8 checks passed
@Shironex Shironex deleted the fix/electron-initial-auth branch January 8, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge Use this label if something should not be merged. Work-In-Progress Currently being addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant