Skip to content
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

Changing Projects on the stripe CLI does not change the webhook secret. #1118

Open
Shawns2759 opened this issue Aug 29, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Shawns2759
Copy link

Issue

I am using the Stripe CLI to listen for webhook events locally, I started a new project using stripe and when i run stripe listen --forward-to=localhost:3000/api --project-name=my_project the cli does'nt detect any creds so it promps me to run this command stripe login --project-name=my_project. That command then directs me to the stripe config page. I choose the correct project, it routes me back to the cli. All good so far. The issue is that when i run stripe listen --forward-to=localhost:3000/api --project-name=my_project it starts but with the same webhook used with my old project. I have greped through my entire computer looking for any reference to this secret but i have not found any. I have also removed the stripe cli and reinstalled it.

Expected Behavior

After running stripe login --project-name=new_project, running the stripe listen command for new_project should use the webhook secret associated with new_project, not old_project.

Steps to reproduce

  1. Install Stripe CLI: If the Stripe CLI is not already installed.

    brew install stripe/stripe-cli/stripe
  2. Login to Old Project: Authenticate with your old Stripe project.

    stripe login --project-name=old_project

    Follow the on-screen prompts to complete the login.

  3. Listen to Webhooks for Old Project: Start listening to webhooks on your old project.

    stripe listen --forward-to=localhost:3000/api --project-name=old_project

    Note down the webhook secret that is displayed in the CLI.

  4. log into the New Project: Authenticate with your new Stripe project.

    stripe login --project-name=new_project

    Follow the on-screen prompts to complete the login.

  5. Listen to Webhooks for New Project: Now start listening to webhooks on your new project.

    stripe listen --forward-to=localhost:3000/api --project-name=new_project

Compare the two webhook secrets. They should be different. But they are not :(

Traceback

No error thrown

Environment

MAC

@Shawns2759 Shawns2759 added the bug Something isn't working label Aug 29, 2023
@jadengis
Copy link

I also ran into this exact issue. I logged out of my account and back in with another account but my stripe cli continues to connect to the previous account. I am unable to receive webhooks from my new account. Uninstalling and reinstalling the CLI does not help and the webhook secret is not stored in .config/stripe/config.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants