diff --git a/docker-compose.example.yml b/docker-compose.example.yml index 2fc1f0f..4e44cc9 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -6,6 +6,8 @@ services: build: context: . network: 'host' + environment: + - APP_URL=https://domain.com ports: - '80:8080' restart: 'always' \ No newline at end of file diff --git a/src/routes/options.go b/src/routes/options.go index 1728479..cf887bd 100644 --- a/src/routes/options.go +++ b/src/routes/options.go @@ -28,11 +28,11 @@ func ChangeOptions(c *gin.Context) { // get redirect url from query redirectUrl := c.Query("redirect_url") if redirectUrl == "" { - redirectUrl = "/" + redirectUrl = os.Getenv("APP_URL") } if !strings.HasPrefix(redirectUrl, os.Getenv("APP_URL")) { - redirectUrl = "/" + redirectUrl = os.Getenv("APP_URL") } c.Redirect(302, redirectUrl)