Closed VanCalsterFinn closed 6 months ago
This soudns like a question for Stackoverflow, not a deployment issue with InvenTree.
Did you confirm that you can access http://localhost/api/user/token/
via another method such as a web browser or CURL?
I got access through direct web browser url, but not via laravel Http client, altough it worked with the previous version of inventree, when the docker install was cloning github and a couple docker commands without the caddyfile. Im unsure if it has anything to do with the domains, using inventree.localhost or just localhost, i tried both, but it doesnt change anything.
Deployment Method
Steps to Reproduce
Describe the problem*
I followed all the steps to setup an Inventree Production instance and it is running perfectly. I also created an admin account after the installation, as suggested in the documentation. However i ran into an issue when trying to communicate with Inventree from a Laravel application running on the same device and domain. I am trying to request an Inventree API Token from my Laravel application. The Laravel application is hosted at "http://localhost:8080". In the .env file of Inventree, i've changed the INVENTREE_SITE_URL to "http://localhost". Both applications are running fine. From my laravel application I am trying to call this API: $response = Http::withBasicAuth($username, $password)->get("http://localhost/api/user/token/"); I have checked multiple times that the credentials are correct and that the syntax of the API call is correct too, Ive copied it straight from the api-docs provided by Inventree. In relevant log output, i have included the response from the API attempt. When i attempt to call the API, i don't get any output in the inventree docker container either. if my Laravel application is making a request to http://localhost/api/user/token/, it should be handled by Caddy and reverse proxied to the Inventree server container. But this does not seem to happen since there are no logs. I am lost. Is there anything i've missed? Thanks in advance!
Steps to Reproduce
Relevant log output