Skip to content

feat(cli): make url optional for login command (#10925) #12466

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

Merged
merged 4 commits into from
Mar 11, 2024

Conversation

elasticspoon
Copy link
Contributor

@elasticspoon elasticspoon commented Mar 8, 2024

Allow coder login to log into existing deployment if available and indicate URL used.

$ > go run ./cmd/coder/main.go login
Attempting to authenticate with saved URL: http://localhost:8080
Your browser has been opened to visit:

        http://localhost:8080/cli-auth

> Paste your token here: KtJjNBnP6D-EiYB7ADdUfOBBn66lVLXTy
> Welcome to Coder, admin! You're authenticated.

This PR also updates related error and help messages to indicate coder login is available as a command.

Fixes #10925
Fixes #9551

@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@elasticspoon
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

cdrcommunity added a commit to coder/cla that referenced this pull request Mar 8, 2024
@elasticspoon elasticspoon marked this pull request as ready for review March 8, 2024 01:29
Allow `coder login` to log into existing deployment if available.

Output to indicate saved URL was used.

Update help and error messages to indicate that `coder login` is
available as a command.
@kylecarbs kylecarbs requested a review from mafredri March 8, 2024 10:06
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Thank you for this PR! I have a couple of improvement suggestions but otherwise this looks really good.

It doesn't make sense to output Authing with ...
then fail. This moves the output later in the login
process to prevent that.
@elasticspoon elasticspoon requested a review from mafredri March 8, 2024 20:45
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

This turned out great, thanks for your contribution!

@mafredri mafredri merged commit 773862a into coder:main Mar 11, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2024
@elasticspoon elasticspoon deleted the cli-use-config-url branch March 11, 2024 14:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Pull Requests and issues created by the community.
Projects
None yet
2 participants