Stripe testing issues(401) (SOLVED)

I’ve been playing around with opensaas and its a great project! However, stripe has been giving me issues, specifically testing stripe. I read the documentation repeatedly, setting up the env vars. However, when I click ‘buy’, it calls auth/me, which returns a 401 for some reason. I console.log(user) right before this call, and I am definitely logged in. It also clears my auth token from cookies, which means I can’t proceed with stripe testing, since it logs me out. Anyone encountered this issue before? I’m trying to debug it but I’m not as familiar with wasp/ts in general.
No description
13 Replies
Raccoon
Raccoon5mo ago
Nevermind, I figured it out. Theres a check for email thats mandatory, otherwise it throws a 401. Solution is to remove it for development
martinsos
martinsos5mo ago
Nice job on figuring it out! Do you think we should do something to prevent somebody else getting confused with this in the future? Should we add somethign to the docs / code?
Raccoon
Raccoon5mo ago
Yea I think something added to the docs would help, I don't think this was mentioned, and it felt implied that there was no need to swap auth methods to get stripe integration working. That or maybe generating an email based on the username if its using default login. I wouldn't mind opening a PR to add this later, when I have some time
martinsos
martinsos5mo ago
Sure, that would be helpful :)! @Vinny (@Wasp) FYI
Raccoon
Raccoon5mo ago
I opened an issue here, to confirm approach to solve this, before I open a PR for this: https://github.com/wasp-lang/open-saas/issues/24
MEE6
MEE65mo ago
Wohooo @Raccoon, you just became a Waspeteer level 1!
Vinny (@Wasp)
Vinny (@Wasp)5mo ago
Oh nice thanks for digging into that! I need to check if stripe requires an email on account creation though. Without an email address that will fail I assume you’re using the usernameAndPassword auth method @Raccoon? If so only use that method in development
Raccoon
Raccoon4mo ago
Stripe requires an email account for the merchant, but when "checking out/paying", I tested and email is not required. yup, was just testing the code out and playing around with it
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
Hey I just replied to the issue. Thanks for opening it! I think, because we use the user's email for many checks within the payment process, that we don't remove it. I think if the dev is serious about using stripe, they should upgrade to one of the other auth methods, so updating the error message and docs would be a better fit. btw, I replied to the issue. let me know if you're still interested in opening a PR for it 🙂
Raccoon
Raccoon4mo ago
Yea, let me open a PR when I get back from work :worryPat: Maybe in like 6 hours
Raccoon
Raccoon4mo ago
I don't think I have permissions to make a new branch/have push access
No description
Raccoon
Raccoon4mo ago
Additionally, as far as I can tell, the documentation is in another repository right? I tried looking for the repo in wasp-lang but didn't find it.
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
ah you're right. its in the deployed-version branch. you'll have to fork the repo and create a feature branch on your remote repo. then create a PR let me know if you run into any issues doing that