outpost/embedded: fix login URL not being set correctly from outpost config
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -2,7 +2,6 @@ package proxy
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@ -37,9 +36,13 @@ func intToPointer(i int) *int {
|
||||
}
|
||||
|
||||
func (pb *providerBundle) replaceLocal(url string) string {
|
||||
if strings.Contains(url, "localhost:8000") {
|
||||
f := strings.ReplaceAll(url, "localhost:8000", pb.s.ak.Client.GetConfig().Host)
|
||||
f = strings.ReplaceAll(f, "http://", fmt.Sprintf("%s://", pb.s.ak.Client.GetConfig().Scheme))
|
||||
if strings.HasPrefix(url, "http://localhost:8000") {
|
||||
authentikHost, c := pb.s.ak.Outpost.Config["authentik_host"]
|
||||
if !c {
|
||||
pb.log.Warning("Outpost has localhost API Connection but no authentik_host is configured.")
|
||||
return url
|
||||
}
|
||||
f := strings.ReplaceAll(url, "http://localhost:8000", authentikHost.(string))
|
||||
return f
|
||||
}
|
||||
return url
|
||||
|
||||
Reference in New Issue
Block a user