stripe/stripe-cli

`stripe login` producing pairing code, but no URL.

Opened this issue · 6 comments

Issue

I was trying to setup the stripe CLI to test out my site's functionality while in Stripe Test Mode, and tried to log in, but did not receive a URL when logging in. I was able to overcome it by using stripe login --interactive and providing my Test Secret Key as the API Key.

Expected Behavior

Receive a URL like this:

$ stripe login
Your pairing code is: enjoy-enough-outwit-win
This pairing code verifies your authentication with Stripe.
Press Enter to open the browser or visit https://dashboard.stripe.com/stripecli/confirm_auth?t=THQdJfL3x12udFkNorJL8OF1iFlN8Az1 (^C to quit)

Rather than hanging before receiving a URL:

$ stripe login
Your pairing code is: enjoy-enough-outwit-win
This pairing code verifies your authentication with Stripe.
[hangs]

Steps to reproduce

  1. Then follow the steps under the apt tab of
    https://docs.stripe.com/stripe-cli#install
$ curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | sudo tee /usr/share/keyrings/stripe.gpg
$ echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list.d/stripe.list
$ sudo apt update
$ sudo apt install stripe
  1. Then type stripe login in to the terminal.
$ stripe login

Environment

Ubuntu 22.04.2 LTS on WSL2
stripe version 1.19.4

Hey, thanks for the report! I wasn't able to reproduce this on Mac or Ubuntu (non-WSL2). I'll see if I can somehow get ahold of a system with WSL2 to try and reproduce this.

For sure! Let me know if there's any other information I can provide that would be helpful.

Quick update -- I got Ubuntu 22 running on WSL1 but wasn't able to repro anything. I'm still trying to see if I can get WSL2 running somehow (long story short we don't have easy access to machines that can run the right Windows VMs).

Looking at the code,I wonder if the spinner is causing problems:

fmt.Println(ansi.Faint("This pairing code verifies your authentication with Stripe."))

If you do stripe --color=off login does that work?

It doesn't:
image

Ah bummer. I'll keep trying to see if I can reproduce but in the mean time --interactive (like you did) should keep you unblocked.

I've come across the same issue today on windows, stripe v1.21.11

*edit: works in terminal, issue only occurs for me in powershell