Skip to content

Commit

Permalink
Fix login command in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Aug 7, 2024
1 parent 60dfb14 commit 3648cf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-lamps-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@e2b/cli": patch
---

Fix login command
4 changes: 2 additions & 2 deletions packages/cli/src/commands/auth/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as e2b from 'e2b'
import { pkg } from 'src'
import { DOCS_BASE, getUserConfig, USER_CONFIG_PATH, UserConfig } from 'src/user'
import { asBold, asFormattedConfig, asFormattedError } from 'src/utils/format'
import { client, ensureAccessToken } from 'src/api'
import { client } from 'src/api'

const getTeams = e2b.withAccessToken(client.api.path('/teams').method('get').create())

Expand All @@ -35,7 +35,7 @@ export const loginCommand = new commander.Command('login')
return
}

const accessToken = ensureAccessToken()
const accessToken = userConfig.accessToken
const res = await getTeams(accessToken, {})
if (!res.ok) {
const error: e2b.paths['/teams']['get']['responses']['500']['content']['application/json'] = res.data as any
Expand Down

0 comments on commit 3648cf8

Please sign in to comment.