Hello Folks,
I have spent the full day trying to figure this one out but unfortunately it hasnt worked.
I am running a custom version of the Admin which I ejected a while back. At the moment I am attempting to run the backend on Heroku which seems to have worked fine. I can see the logs of the backend on Heroku.
I am facing issues authenticating my self into the Medusa Backend with the Admin running locally. On LogIn the useAdminLogIn successfully sends a post request to the backend .
2023-09-07T21:44:27.314324+00:00 app[web.1]: 24.185.40.252 - - [07/Sep/2023:21:44:27 +0000] "POST /admin/auth HTTP/1.1" 200 309 "http://localhost:7001/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
On succesful login I receive the user object in LogInCard(https://github.com/medusajs/medusa/blob/develop/packages/admin-ui/ui/src/components/organisms/login-card/index.tsx#L19) which I console log.
The LogIn Card navigates to orders which is a protected page. This triggers the hook useAdminGetSession() in PrivateRoute pasted below. The useAdminGetSession() request is failing with Unauthorized Access 401. And the returned user object is undefined.
Any help will be appreciated!!! My initial hunch is that this is a cookie,token error.