Skip to content

Proton Pass: fix browser login, show its progress, add Check Again and Logout - #31877

Merged
raycastbot merged 25 commits into
raycast:mainfrom
bst1n:proton-pass-login-fixes
Oct 10, 2026
Merged

raycastbot merged 25 commits into
raycast:mainfrom
bst1n:proton-pass-login-fixes

Conversation

@bst1n

@bst1n bst1n commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes browser logins that succeeded in the browser while the extension stayed logged out, and makes the Not Logged In screens say what's going on.

  • Browser login no longer fails when the extension opens again right after it. pass-cli login saves the new session a few seconds after the browser step, and the extension ran other pass-cli commands meanwhile: reopening Search Items lists vaults. A command starting while the session is saved can find its data without its keyring key yet, and pass-cli then logs out "for security" (features/keyring.rs), deleting the session folder being written. The login then ends with Error opening temp session file: No such file or directory; in a failing login, another command had started in the same second. No pass-cli command runs during a login now: the views show the login screen until it's over. A login in the terminal never hits this, since nothing else runs then.
  • The login runs on its own. pass-cli login ran inside the extension, which Raycast can stop once the browser comes to the front. It now runs detached, writing to a file in the extension's support folder, where its state is kept too. Both are removed once the login is over, since the output holds the login URL and its payload. Opening the extension again picks a running login up.
  • The screens say what's happening.
    • Login with Browser keeps the screen as it is, with an "Opening the Login Page" toast, until the browser is in front.
    • Then "Log In in Your Browser", with Open Login Page Again, Check Again and Cancel Login, and "Finishing the Login" once pass-cli has the browser login.
    • Then "You're Logged In — Loading your items…" until Search Items, List Vaults or Get TOTP has something to show, instead of an empty list.
    • A failed login shows pass-cli's error, without the URL, payload or email addresses.
    • Get TOTP's Not Logged In screen is the same screen, so it can log in too.
  • Check Again (⌘R) on Not Logged In screens picks up a session from a login done elsewhere.
  • Logout in the Login command, after a confirmation, since the terminal shares the session. When ending the session on Proton's servers fails, the failure toast offers Force Logout.
  • Open Terminal Login uses the extension's pass-cli, quoted for the shell, and brings Terminal to the front.

The tests run the detached login with the fake CLI:

  • success, and a URL split across writes;
  • failures, without exposing the payload;
  • cancel, timeout, and a pass-cli stopped by a signal;
  • an exit the extension missed, and the "finishing" step.

They also cover the guard that keeps other commands from running during a login, and the screens' sequence.

npm test passes (160 tests) and ray build succeeds.

Screencast

No new command: the Not Logged In screens gain the login's progress, and the Login command a Logout action.

Checklist

🤖 Generated with Claude Code


Note

Medium Risk
Changes authentication orchestration and session timing (detached processes, blocking other CLI during login), but behavior is heavily tested and errors redact sensitive login output.

Overview
Fixes browser login races where reopening the extension right after authenticating could leave you logged out: while pass-cli saves the session, no other pass-cli calls run until login finishes.

Detached login replaces the in-process flow: pass-cli login runs on its own with state under the extension support folder, survives Raycast closing, and is picked up when you return. Not Logged In screens (Search Items, List Vaults, Get TOTP, Login) share a LoginScreen with step-by-step status (browser, finishing, loading items), Open Login Page Again, Cancel Login, and Check Again (⌘R) for sessions completed elsewhere.

The Login command adds Logout (with confirmation and Force Logout fallback) via new adapter logout support. Open Terminal Login uses the same bundled/configured pass-cli with safe shell/AppleScript quoting and activates Terminal. List Vaults shows vaults and item counts immediately and applies optional sharing metadata when it arrives.

Reviewed by Cursor Bugbot for commit 31d7242. Bugbot is set up for automated code reviews on this repo. Configure here.

…extension's pass-cli

- Not Logged In screens (Search Items, List Vaults and the Login command)
  have a Check Again action (Cmd+R), which picks up a session started
  elsewhere, such as a browser login that completed after Raycast closed
- Open Terminal Login ran whichever `pass-cli` the shell found, while the
  extension runs the CLI Path preference or the pass-cli it installed. It
  now runs the same one, quoted for the shell since the installed path
  contains spaces, and brings Terminal to the front. The script builder is
  a tested core helper

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: proton-pass Issues related to the proton-pass extension platform: macOS platform: Windows labels Oct 3, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @izyuumi @FeernandoOFF you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="proton-pass-login-fixes"
FORK_URL="https://github.com/bst1n/extensions.git"
EXTENSION_NAME="proton-pass"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Refactors browser login flow and adds logout capability.

The PR needs its changelog heading corrected before merging.

Findings

  1. P2 Release date is set early ▶
Fix with agent prompt
### Issue 1
extensions/proton-pass/CHANGELOG.md:3
The new `CHANGELOG.md` heading uses a fixed date. The repository requires new changelog headings to keep `{PR_MERGE_DATE}` so the date can be filled in when the PR merges. Please restore the placeholder before merging.

```suggestion
## [Login Fixes] - {PR_MERGE_DATE}
```

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Proton Pass browser login now continues if Raycast closes, and other CLI commands wait until the session is saved so they do not interfere. The login screens show progress and recovery options, while the Login command adds Logout and List Vaults shows results before optional sharing details arrive.

  • Browser login keeps running while Raycast is closed.
  • Login screens show progress and help you finish or retry.
  • The Login command can log out of Proton Pass.
  • Terminal login uses the same pass-cli as the extension.
  • List Vaults shows vaults before optional sharing details arrive.

Reviews (18) · Last reviewed commit: "Update CHANGELOG.md" · Reviewed by Greptile

Comment thread extensions/proton-pass/src/list-vaults.tsx Outdated

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread extensions/proton-pass/src/list-vaults.tsx Outdated
Comment thread extensions/proton-pass/src/list-vaults.tsx Outdated
Check Again could overlap with the reload after a browser login, and an
older failed check could then put the Not Logged In screen back over the
vaults loaded since. Loads now go through a request tracker, as in Search
Items, and each one shows the loading state, so Check Again no longer
flashes No Vaults Found or the vaults of the ended session, which are
also cleared once the session has ended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread extensions/proton-pass/src/lib/login-view.tsx Outdated
New actions go at the end of the action panel, so the existing ones keep
their place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pernielsentikaer pernielsentikaer self-assigned this Oct 5, 2026
@pernielsentikaer

Copy link
Copy Markdown
Collaborator

@bst1n can you resolve the merge conflicts 🙂

…ton-pass-login-fixes

# Conflicts:
#	extensions/proton-pass/CHANGELOG.md

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread extensions/proton-pass/src/lib/search-items-view.tsx Outdated
bst1n and others added 6 commits October 6, 2026 21:46
Check Again cleared the Not Logged In error before the list was loading,
so the empty list showed "No Items Found" for a moment, with the vault
menu still holding the ended session's vaults. Search Items now loads
from the start of each load, and an ended session clears its vaults as
well as its items, as List Vaults does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Login with Browser ran `pass-cli login` inside the extension and waited
for it there. Once the browser came to the front, Raycast could stop the
extension before the login completed, with nothing on screen saying so:
the browser showed a successful login, and the extension stayed logged
out.

pass-cli now runs on its own, writing to a file in the extension's
support folder, so the login completes however long it takes in the
browser. Its state is kept there too, and removed once the login is
over, since the output holds the login URL and its payload.

While the login runs, the Not Logged In screen says to finish it in the
browser, with Open Login Page Again, Check Again and Cancel Login, and
checks on it every second. Opening the extension again picks a running
login up. Once pass-cli exits, its exit code, or else the session, tells
success from failure: the view reloads, or says why the login didn't
complete. The Login command and Get TOTP use the same screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssion

A browser login failed with "Error opening temp session file: No such
file or directory": the extension had started another pass-cli command
as the login was saving the new session. That command can find the
session's data without its key yet, and pass-cli then logs out "for
security", deleting the session folder being written. A login in the
terminal works because nothing else runs meanwhile.

The running login is now recorded as soon as pass-cli starts, and every
pass-cli command waits for it to end: the views show the login screen,
which follows the login and reloads once it has completed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clicking Login with Browser switched screens twice just as the browser
came to the front and closed Raycast. The screen now stays as it is,
with an "Opening the Login Page" toast, until the browser is in front.

Coming back, the view showed Not Logged In until it found the running
login, then said to log in in the browser although that was done:
pass-cli checks the browser every 10 seconds. It now spins until it
knows, says the login continues by itself within about 10 seconds, and
says when pass-cli is saving the session.

Once logged in, Search Items, List Vaults and Get TOTP showed an empty
list while loading the items. They now keep the login screen, saying
you're logged in, until there's something to show; Check Again keeps it
too, rather than flashing an empty list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was no way to log out from the extension. The Login command's
logged-in screen now has Logout, after a confirmation that the terminal
shares the session. It ends the session with pass-cli and clears the
extension's cache. When ending the session on Proton's servers fails,
e.g. offline, the failure toast offers Force Logout, which only removes
it from this computer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bst1n bst1n changed the title Proton Pass: Check Again when not logged in, Terminal login with the extension's pass-cli Proton Pass: fix browser login, show its progress, add Check Again and Logout Oct 7, 2026
Comment thread extensions/proton-pass/src/login.tsx
Comment thread extensions/proton-pass/src/lib/pass-cli.ts Outdated
Comment thread extensions/proton-pass/src/lib/pass-cli.ts Outdated
Comment thread extensions/proton-pass/src/login.tsx Outdated
- After a login, "You're Logged In" stays while the view loads, then the
  login screen gets its actions back if the view still shows it. After
  Logout in the Login command, it showed "You're Logged In" with no
  actions.
- The previous account's cache is cleared when a browser login starts,
  rather than when a view notices it completed: a view opened first
  after the login could show the previous account's items.
- A login whose page couldn't open in the browser is canceled: nobody
  could finish it, and no other pass-cli command runs while it does.
- Logout comes after the existing actions in the Login command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bst1n

bst1n commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer the merge conflicts are resolved 🙂 Since then, this PR also fixes the browser login: it could succeed in the browser while the extension stayed logged out. The description explains the cause and the fix. It's ready for review.

@izyuumi

izyuumi commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Validated the current head 2edf907830ef2a3e68fe9612b57b289a9dcccb28, preserving the recent cache, browser-open cancellation, logout, and action-order fixes.

One additional regression remains: cancel a login whose process takes time to stop, complete a replacement login, then let the canceled process exit. Its late failure overwrites the shared exit-code file and Check Again reports failure for the successful replacement.

Implemented a small follow-up in bst1n/extensions#1, targeting this PR's branch: exit results are separated by process ID. The synthetic delayed-cancellation test fails before the fix and passes afterward. All 135 tests, distribution build/TypeScript, Raycast metadata validation, ESLint, Prettier, and diff checks pass. No real account or password CLI was used.

The follow-up is a draft for human review and integration; this PR remains the Raycast publication path.

It fixes the login flow this PR adds, which isn't released yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pass-cli's exit code can be written into the login folder while it's
removed, after a cancel or once the login is over: the removal then
failed as "directory not empty", e.g. Cancel Login showed that error.
The login tests hit it under load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bst1n

bst1n commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @izyuumi for testing it and for the fix 🙏 Good catch. I merged it into this branch.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings could not be posted inline.

  • P2 Review finding ▶

    Confidence Score: 5/5

    The latest changes appear safe to merge.

    What we checked:

    • Vault contents survive cache clearing: clearCache removes only cached items and vaults from local storage. It does not delete anything from Proton.

    Summary

    The PR lets browser login continue after Raycast closes, shows login progress, and adds Check Again and Logout.

    • Browser login keeps running while Raycast is closed.
    • Login screens show progress until the requested data loads.
    • The Login command can end the shared Proton Pass session.
    • Terminal login uses the extension’s CLI and brings Terminal forward.

…mand

Its files, which hold the login URL, stayed until a login screen read
the result, but none shows once logged in: after a login that
succeeded while Raycast was closed, they stayed on disk. The check that
runs before every pass-cli command now removes them once pass-cli has
exited, unless the login failed: the login screen, which then shows,
still says why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread extensions/proton-pass/src/lib/core/login.ts Outdated
…screen

Once pass-cli has exited, the next pass-cli command removed the
login's files when the exit code was missing, which happens when
Raycast closed first. A failed login then reached the login screen
without its explanation. Only a login that exited with 0 is removed
now; otherwise the URL is taken out of the files, and why the login
failed stays until the login screen reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread extensions/proton-pass/src/lib/core/login.ts Outdated
Cleaning up after a finished login read the shared files, then
rewrote them: a login started in between could lose its output, and
its saved state could be replaced by the finished one's, letting other
pass-cli commands run during it. Each attempt now writes its output
and failure to files named after it, and login.json no longer holds
the URL, which is read from the output. The cleanup only removes the
finished attempt's output, after saving why it failed, and never
writes login.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread extensions/proton-pass/src/lib/core/login.ts Outdated
Comment thread extensions/proton-pass/src/lib/core/login.ts Outdated
Two cleanups of the same finished login could overlap: the second read
the output after the first removed it, and overwrote the saved failure
with nothing. The failure is now only written when there's a reason.

A login whose output was forgotten kept its success result, which the
next login screen showed even after Logout. Such a login's result now
comes from the current session: succeeded when logged in, otherwise
its saved failure, or nothing. Logout also forgets a finished login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread extensions/proton-pass/src/lib/pass-cli.ts Outdated
bst1n and others added 2 commits October 8, 2026 22:17
…tarted

Logout canceled whatever login was saved once it was done, so a login
started from the Login command while Logout waited for pass-cli was
stopped. Logout now reads the saved login first, which can only be
over since a running one stops Logout, and afterwards only removes that
attempt's files, never the saved state another login may have written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ton-pass-login-fixes

# Conflicts:
#	extensions/proton-pass/CHANGELOG.md
#	extensions/proton-pass/src/lib/review-regressions.test.ts
#	extensions/proton-pass/src/lib/search-items-view.tsx
#	extensions/proton-pass/src/list-vaults.tsx

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread extensions/proton-pass/src/login.tsx
…ogin

The Login command shows Re-Run Browser Login while the check of an
earlier login may still be running. That check removed the new login's
files and then reported its own result over the new login's: the
screen stopped following a login that was still running. Starting or
canceling a login now waits for the check in flight, and no check
starts while a login is being started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e687d61. Configure here.

Comment thread extensions/proton-pass/src/lib/login-view.tsx Outdated
bst1n and others added 2 commits October 10, 2026 10:38
Canceling waited for the check in flight, but the view could start
another one while pass-cli was stopped and its files removed, which
takes a moment. That check still found the login, and put it back on
screen after the cancel. No check starts while a login is being
canceled now, as while one is being started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@izyuumi

izyuumi commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Validated both remaining outside-diff sharing findings on current head f0a21c6156f18eba97e28493a360f6c19f0ad189; both reproduce with synthetic services.

  • List Vaults remains loading after its primary listing is ready while optional sharing is stalled. The fix shows/caches fetched vaults and counts first, then applies sharing using the existing latest-request and save-order guards.
  • A sharing refresh starts member commands after login becomes active, either after a delayed role lookup or from the queued member work. The fix calls the existing guarded getAdapter() before each member command.

Implemented the narrow follow-up in bst1n/extensions#3, targeting this branch. The three regression cases fail before the fix and pass afterward; the older-response sharing/count regression also remains green. All 160 tests, distribution build/TypeScript, Raycast metadata validation, ESLint, Prettier, and diff checks pass. No real account, password CLI, or actual session disruption was used.

The changes preserve e687d611 and f0a21c61, including their login-check race coverage. The follow-up is a draft for human review/integration into this existing Raycast publication PR. Loading behavior follows the Raycast empty-state guidance.

The login guard on member commands is part of the login flow this PR adds, which isn't released yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bst1n

bst1n commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @izyuumi for testing it and for the fix 🙏 I merged it into this branch.

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit b94f62e into raycast:main Oct 10, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/izyuumi/proton-pass

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@bst1n).

Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

@@ -1,5 +1,16 @@
# proton-pass Changelog

## [Login Fixes] - 2026-10-10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Release date is set early

The new CHANGELOG.md heading uses a fixed date. The repository requires new changelog headings to keep {PR_MERGE_DATE} so the date can be filled in when the PR merges. Please restore the placeholder before merging.

Suggested change
## [Login Fixes] - 2026-10-10
## [Login Fixes] - {PR_MERGE_DATE}

Rule Used: What: Changelog entries must use {PR_MERGE_DATE} placeholder in titles, be placed at the top of the file, and maintain descending version order. Why: Standardized placeholders and consistent ordering ensure changelogs are maintainable and merge da... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/proton-pass/CHANGELOG.md
Line: 3

Comment:
**Release date is set early**

The new `CHANGELOG.md` heading uses a fixed date. The repository requires new changelog headings to keep `{PR_MERGE_DATE}` so the date can be filled in when the PR merges. Please restore the placeholder before merging.

```suggestion
## [Login Fixes] - {PR_MERGE_DATE}
```

**Rule Used:** What: Changelog entries must use `{PR_MERGE_DATE}` placeholder in titles, be placed at the top of the file, and maintain descending version order.  Why: Standardized placeholders and consistent ordering ensure changelogs are maintainable and merge da... ([source](https://app.greptile.com/raycast/-/custom-context?memory=c2214c11-df56-490a-b1c0-09a385df481a))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: proton-pass Issues related to the proton-pass extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants