git push not working using Gitea on docker with traefik with basicauth

  docker, docker-compose, git, gitea, traefik

I am setting up Gitea on docker for version tracking.
I run this on docker (docker-compose) with traefik as reverse proxy.
I have set up traefic with basicauth as I dont want anyone to have access to the web interface.
I dont know if I can make gitea accessible only to those who are supposed to (for example a team of devs), so I figured this is a good option atm.

I can git clone fine, but here I have to give the basicauth credentials NOT the user credentials of my gitea account. When I am going to git push it asks me for login details. but it doesnt recognize the login details I give it, whether they are the basicauth or gitea account details. (though it makes sence it would be the basicauth credentials).

Below is the response

remote: invalid credentials from <IP Address of Computer>
fatal: Authentication failed for 'https://<URL>/<PATH to repo>.git/'

I want to point out that both clone and push works when basicauth isn’t present/"turned off"


Source: Docker Questions