-
Notifications
You must be signed in to change notification settings - Fork 14
fix(auth): make Login always prompt and harden org fetch #66
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -185,12 +185,18 @@ export async function activate( | |
| ) | ||
| context.subscriptions.push(service) | ||
| vscode.commands.registerCommand(`${EXTENSION_PREFIX}.login`, async () => { | ||
| // The getSession call is intentionally side-effect-only: passing | ||
| // `createIfNone: true` triggers the login flow if no session | ||
| // exists; we don't need the returned session here. | ||
| await vscode.authentication.getSession(EXTENSION_PREFIX, [], { | ||
| createIfNone: true, | ||
| }) | ||
| // An explicit Login must always let the user re-enter a token, even when a | ||
| // stale or cached session already exists. `createIfNone` only prompts when | ||
| // NO session is present, so a leftover session made the command a silent | ||
| // no-op and left the user with no way in at all (SURF-414). | ||
| // `forceNewSession` always runs the token flow. The returned session is | ||
| // unused; the catch swallows the rejection VSCode raises when the user | ||
| // dismisses the prompt, which is a cancel and not a command failure. | ||
| try { | ||
| await vscode.authentication.getSession(EXTENSION_PREFIX, [], { | ||
| forceNewSession: true, | ||
| }) | ||
| } catch {} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Login catch hides real failuresMedium Severity The new Login Reviewed by Cursor Bugbot for commit 9ee6c54. Configure here. |
||
| }) | ||
| try { | ||
| await syncLiveSessionFromSecretStorage() | ||
|
|
||


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.
Internal ticket ID in source
Low Severity
New comments embed the Linear-style id
SURF-414in shipped source and tests. Fleet public-surface hygiene forbids ticket refs in code and comments, so this leaks an internal tracker id into the public repo and extension bundle.Additional Locations (1)
test/auth.test.mts#L207-L210Reviewed by Cursor Bugbot for commit 9ee6c54. Configure here.