Skip to content

Commit 6f63aea

Browse files
authored
Merge pull request #341 from cipherstash/cli-fix
fix: invalid client on init
2 parents e968ff9 + 0d21e9b commit 6f63aea

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.changeset/petite-cities-lose.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cipherstash/cli": minor
3+
---
4+
5+
Fix invalid client error.

packages/cli/src/commands/auth/login.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ export async function selectRegion(): Promise<string> {
2727
return region
2828
}
2929

30-
export async function login(region: string, referrer: string | undefined) {
30+
export async function login(region: string, _referrer: string | undefined) {
3131
const s = p.spinner()
3232

33-
const pending = await beginDeviceCodeFlow(
34-
region,
35-
`cli-${referrer ?? 'cipherstash'}`,
36-
)
33+
// Must be 'cli' — it's the only OAuth client_id registered with CTS.
34+
// Passing anything else (e.g. `cli-supabase`) causes INVALID_CLIENT.
35+
const pending = await beginDeviceCodeFlow(region, 'cli')
3736

3837
p.log.info(`Your code is: ${pending.userCode}`)
3938
p.log.info(`Visit: ${pending.verificationUriComplete}`)

0 commit comments

Comments
 (0)