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"
"strings"
"github.com/casdoor/casdoor/conf"
"github.com/casdoor/casdoor/util"
"github.com/duo-labs/webauthn/webauthn"
"xorm.io/core"
@ -527,11 +526,8 @@ func GetUserInfo(userId string, scope string, aud string, host string) (*Userinf
if user == nil {
return nil, fmt.Errorf("the user: %s doesn't exist", userId)
}
origin := conf.GetConfigString("origin")
_, originBackend := getOriginFromHost(host)
if origin != "" {
originBackend = origin
}
resp := Userinfo{
Sub: user.Id,