fix(auth): resolve a bare GITEA_TOKEN host in completion and the Git helper

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 20:31:09 +02:00
1 parent c22e8550da
commit 048bb291fc
4 files changed
+28 -6

No files matched your search

+1 -1
View File
@@ -303,7 +303,7 @@ func (a *application) completionTarget(ctx context.Context, requireRepo bool) (t
var signer *auth.HTTPSign
token := a.deps.Getenv("GITEA_TOKEN")
if token != "" {
if instance, err := settings.NormalizeHost(a.tokenInstance()); err != nil || instance != t.Host {
if instance, err := settings.ResolveHost(a.tokenInstance(), t.hosts()); err != nil || instance != t.Host {
return t, errors.New("GITEA_TOKEN belongs to another instance")
}
} else {