Use app.conf value in getOriginFromHost()

This commit is contained in:
Gucheng Wang
2022-09-03 15:12:26 +08:00
parent af9ae7dbb7
commit 4536fd0636
6 changed files with 13 additions and 29 deletions

View File

@ -18,7 +18,6 @@ import (
"fmt"
"time"
"github.com/casdoor/casdoor/conf"
"github.com/casdoor/casdoor/util"
"github.com/golang-jwt/jwt/v4"
)
@ -67,11 +66,7 @@ func generateJwtToken(application *Application, user *User, nonce string, scope
refreshExpireTime := nowTime.Add(time.Duration(application.RefreshExpireInHours) * time.Hour)
user.Password = ""
origin := conf.GetConfigString("origin")
_, originBackend := getOriginFromHost(host)
if origin != "" {
originBackend = origin
}
name := util.GenerateId()
jti := fmt.Sprintf("%s/%s", application.Owner, name)