medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
26.25k stars 2.67k forks source link

Getting Cors on admin even after following the guide #5784

Closed oliwerhelsen closed 1 year ago

oliwerhelsen commented 1 year ago

Bug report

Describe the bug

I am trying to create a session by using "useAdminLogin" from medusa-react. But I keep getting cors issue even though the configuration is done accordingly.

System information

Medusa version (including plugins): Node.js version: v21.1.0 Database: Postgres Operating system: macOS Sonoma Browser (if relevant): Chrome

Steps to reproduce the behavior

  1. Create dummy application
  2. Setup medusa-react following the guide on medusa docs.
  3. Try to login.

Expected behavior

Getting a session cookie.

Screenshots

Screenshot 2023-12-01 at 10 53 28 Screenshot 2023-12-01 at 10 53 05 Screenshot 2023-12-01 at 10 52 24 Screenshot 2023-12-01 at 10 51 51 Screenshot 2023-12-01 at 10 51 43

bkvaiude commented 1 year ago

@oliwerhelsen How did it worked for you? I have upgraded medusa version to 1.18.1 and latest medusa admin package. Now, I'm getting the same error! Please provide more insights on the fix!

bkvaiude commented 1 year ago

It is strange! I was using windows with ubuntu via WSL feature! After restarting the machine it started working!

oliwerhelsen commented 12 months ago

@bkvaiude nice that it worked out for you. My problem was that I didn't provide the protocol in my client application. MEDUSA_BASE_URL most be with http/-s 🤦