Skip to content

Do not require token auth with mTLS #378

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
Oct 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Name login arguments
  • Loading branch information
code-asher committed Oct 29, 2024
commit f6769a3d98a93da154eaa244286d283310bcf5c3
8 changes: 4 additions & 4 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ export class Commands {
* Log into the provided deployment. If the deployment URL is not specified,
* ask for it first with a menu showing recent URLs and CODER_URL, if set.
*/
public async login(...args: string[]): Promise<void> {
const url = await this.maybeAskUrl(args[0])
public async login([inputUrl, inputLabel, inputToken]: string[]): Promise<void> {
const url = await this.maybeAskUrl(inputUrl)
if (!url) {
return
}

// It is possible that we are trying to log into an old-style host, in which
// case we want to write with the provided blank label instead of generating
// a host label.
const label = typeof args[2] === "undefined" ? toSafeHost(url) : args[2]
const label = typeof inputLabel === "undefined" ? toSafeHost(url) : inputLabel

// Try to get a token from the user, if we need one, and their user.
const res = await this.maybeAskToken(url, args[1])
const res = await this.maybeAskToken(url, inputToken)
if (!res) {
return // The user aborted.
}
Expand Down