Skip to content

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Jul 12, 2024

Description

Fixes #7442

Testing

  • Built VSCode and verified that credentials from 'firebase login' were correctly picked up and the project picker worked correctly.
  • Tested auth from the CLI with an expired refresh_token and verified that firebase logout does not fail with 'run firebase login --reauth'

@joehan joehan requested review from hlshen and aalej July 12, 2024 20:19
@joehan joehan enabled auto-merge (squash) July 12, 2024 20:26
@@ -56,7 +56,7 @@ export async function requireAuthWrapper(
return (
account &&
account.user.email === optionsUser.email &&
account.tokens.access_token === optionsTokens.access_token // TODO: check if this is necessary
account.tokens.refresh_token === optionsTokens.refresh_token // Should check refresh token which is consistent, not access_token which is short lived.
Copy link
Contributor

Choose a reason for hiding this comment

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

++ nice find

// - we are using tokens from configstore (aka those set by firebase login), AND
// - we are calling CLI code that skips Command (where we normally call this)

setAccessToken(await getAccessToken());
Copy link
Contributor

Choose a reason for hiding this comment

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

ahh this is a cleaner solution. Thanks for fixing this!

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.

Tool commands 'logout' and 'login --reauth' fail when credentials are expired in [email protected]
2 participants