WeblateOrg / WeblateOrg/weblate
OpenID Connect will not redirect correctly when not login from SITE_DOMAIN
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 1.4k
- Avg merge
- 9h 53m
- Merged PRs (30d)
- 395
Description
### Describe the issue
My Weblate instance has multiple ALLOWED_HOSTS, and has a oidc login endpoint. When I login with a domain which is not the SITE_DOMAIN, it will redirect to SITE_DOMAIN but not the domain I visit, which cause an invalid session error.
### I already tried
- [x] I've read and searched [the documentation](https://docs.weblate.org/).
- [x] I've searched for similar filed issues in this repository.
### Steps to reproduce the behavior
1. set WEBLATE_ALLOWED_HOSTS to `weblate.example.com,weblate.example.org`, and WEBLATE_SITE_DOMAIN to `weblate.example.com`
2. enable OpenID configuration
3. visit `weblate.example.org`, login with oidc
4. it will redirect to `weblate.example.com`
### Expected behavior
redirect to `weblate.example.org` and login successfully
### Screenshots
_No response_
### Exception traceback
```pytb
```
### How do you run Weblate?
Docker container
### Weblate version
2026.7.1
### Weblate deploy checks
```shell
System check identified no issues (1 silenced).
```
### Additional context
_No response_
Contributor guide
Research direction
Start at the OpenID Connect login endpoint and trace how WEBLATE_ALLOWED_HOSTS and WEBLATE_SITE_DOMAIN are used during the redirect. Reproduce with the two domains from the issue in the Docker setup, then verify that logging in through weblate.example.org returns to that host and creates a valid session.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100