feat: update example compose, change default redirect
This commit is contained in:
parent
d92edafb03
commit
d664899ab6
@ -6,6 +6,8 @@ services:
|
||||
build:
|
||||
context: .
|
||||
network: 'host'
|
||||
environment:
|
||||
- APP_URL=https://domain.com
|
||||
ports:
|
||||
- '80:8080'
|
||||
restart: 'always'
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user