OAuth Redirect URI not working

I have created an OAuth client and set the default redirect uri and the other one as well. But irrespective of my input, the callback goes to https://mydomainhere/api/method/frappe.integrations.oauth2.authorize?response_type=code&redirect_uri=http%3A%2F%2F172.17.0.2%3A3000%2Fauth%2Foauth2%2Fcallback&client_id=<removed>

Seems like it’s hard coded to redirect to irrespective of the domain provided.

Update: the IP is the local address of docker container on which the client application is installed. Why is frappe sending oauth response to that IP when I clearly specified the domain in default URI.

This was fixed by adding an environment variable in docker container.

Which environment variable?

Can you describe in detail? It may help someone in future.

The application I’m using(CodiMD) uses an environment variable CMD_DOMAIN.
I set it’s value to my domain and it worked.

But now, I have issues regarding the profile. I’ll make a new topic and not club it here.