500 error on My Account page for free users
As a free user, I can't actually go to My Account
to upgrade because we assume there is a Braintree customer account associated already (which there clearly is not because they are on the free plan).
Steps to reproduce:
- Start with a new Slack team (that has never had a paid plan)
note: our Slack workspace will never reproduce this
- Go through the standard install process and select
Free
- Go back to listMe.chat and go to
My Account
- Authorize the sign in with Slack
- Observe the 500 error.
This is because of an assumption in app.get('/api/checklogin
that braintree.customer
exists. The My Account page was designed to manage your subscription so in some ways this assumption makes sense. But it means if you don't have a subscription you can't even get to the page.
Will need to check what returning a valid login but lack of a braintree customer will cause here. The workaround is to send the user to the "Add to slack" button and go back through the sign-up flow - which I think is actually how the My Account page handles new sign-ups so it shouldn't be too tough to decouple but it could have unintended consequences