mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
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:
4 files changed
+28
-6
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user