Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/commands/asa/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class AsaConnect extends Command {
this.log('The link is valid for one hour. Sign in to the Adapty dashboard in that browser first — the last')
this.log('step is authorized by the dashboard session, not by this CLI.')

await open(authUrl).catch(() => false)
if (process.stdin.isTTY === true) await open(authUrl).catch(() => false)

if (!flags.wait) return {auth_url: authUrl}

Expand Down
10 changes: 6 additions & 4 deletions src/commands/auth/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@
this.log(`\nYour code: ${device.user_code}\n`)
this.log(`If browser doesn't open, visit: ${device.verification_uri_complete}\n`)

try {
await open(device.verification_uri_complete)
} catch {
// browser open failed silently — URL already printed
if (process.stdin.isTTY === true) {
try {
await open(device.verification_uri_complete)
} catch {
// browser open failed silently — URL already printed
}
}

this.log('Waiting for authorization...')
Expand Down Expand Up @@ -89,7 +91,7 @@
})
} catch (error) {
if (error instanceof ApiError) {
switch (error.errorCode) {

Check warning on line 94 in src/commands/auth/login.ts

View workflow job for this annotation

GitHub Actions / unit-tests (windows-latest, lts/-1)

Blocks are nested too deeply (5). Maximum allowed is 4

Check warning on line 94 in src/commands/auth/login.ts

View workflow job for this annotation

GitHub Actions / unit-tests (ubuntu-latest, lts/-1)

Blocks are nested too deeply (5). Maximum allowed is 4

Check warning on line 94 in src/commands/auth/login.ts

View workflow job for this annotation

GitHub Actions / unit-tests (ubuntu-latest, lts/*)

Blocks are nested too deeply (5). Maximum allowed is 4

Check warning on line 94 in src/commands/auth/login.ts

View workflow job for this annotation

GitHub Actions / unit-tests (windows-latest, lts/*)

Blocks are nested too deeply (5). Maximum allowed is 4
case 'authorization_pending': {
continue
}
Expand Down
Loading