Skip to content
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

Why does firebase login:use <email> require you to be in a Firebase project? #6526

Closed
Yukinosuke-Takada opened this issue Nov 15, 2023 · 4 comments

Comments

@Yukinosuke-Takada
Copy link
Contributor

I wanted to see all Firebase projects that were associated with another account I've added to the firebase-cli. I used the firebase login:use <email> command but got some error that said I needed to be in a Firebase project. I made a firebase project (firebase init) just to change the account. I find it strange since other firebase login commands do not require you to be in a Firebase project.

[REQUIRED] Environment info

firebase-tools: 12.9.0

Platform: macOS 14.0

[REQUIRED] Test case

I get an error:

Error: Could not determine active Firebase project directory

when I use command:

firebase login:use <email>

in a directory that is not a Firebase project.

[REQUIRED] Steps to reproduce

Go to any directory that is not a Firebase project.

firebase login:use <email>

[REQUIRED] Expected behavior

Should be able to change your account inside firebase-cli outside of Firebase projects.

[REQUIRED] Actual behavior

Gives Error that says it requires you to be in a Firebase project

Error: Could not determine active Firebase project directory
@aalej
Copy link
Contributor

aalej commented Nov 16, 2023

Hey @Yukinosuke-Takada, thanks for raising this. I was able to reproduce the error you mentioned. Let me raise this to our team to see what we can do here and try to bring someone to provide additional context about this behavior.

@aalej
Copy link
Contributor

aalej commented Nov 16, 2023

I discussed this with our team, currently the firebase login:use <email> command tells the CLI to use the specified identity for the active Firebase project directory. It seems like this is working as intended.

However, we do agree that it is a reasonable feature to make this command work outside of a Firebase project directory. So for now I’ll be marking this as a feature request. If you’re up for it, feel free to submit a PR!

@Yukinosuke-Takada
Copy link
Contributor Author

Yukinosuke-Takada commented Nov 20, 2023

@aalej Thanks for the reply. I've read the source code myself and understood why this was implemented like this.

I've made a PR of this feature, that makes it possible to use this command outside a Firebase project directory!

@joehan
Copy link
Contributor

joehan commented Nov 30, 2023

Closing this as your PR has been merged and will roll out in the next release. Thanks for the suggestion and contribution!

@joehan joehan closed this as completed Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants