feat: support overriding configuration with env (#590)

This commit is contained in:
Товарищ программист
2022-03-20 23:21:09 +08:00
committed by GitHub
parent 1a6d98d029
commit 5f8924ed4e
21 changed files with 173 additions and 38 deletions

View File

@ -19,7 +19,7 @@ import (
"fmt"
"time"
"github.com/astaxie/beego"
"github.com/casdoor/casdoor/conf"
"github.com/golang-jwt/jwt/v4"
)
@ -67,7 +67,7 @@ func generateJwtToken(application *Application, user *User, nonce string, scope
refreshExpireTime := nowTime.Add(time.Duration(application.RefreshExpireInHours) * time.Hour)
user.Password = ""
origin := beego.AppConfig.String("origin")
origin := conf.GetConfigString("origin")
_, originBackend := getOriginFromHost(host)
if origin != "" {
originBackend = origin