mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: add originFrontend to app.conf
This commit is contained in:
parent
9ea77c63d1
commit
fbc603876f
@ -16,6 +16,7 @@ verificationCodeTimeout = 10
|
|||||||
initScore = 0
|
initScore = 0
|
||||||
logPostOnly = true
|
logPostOnly = true
|
||||||
origin =
|
origin =
|
||||||
|
originFrontend =
|
||||||
staticBaseUrl = "https://cdn.casbin.org"
|
staticBaseUrl = "https://cdn.casbin.org"
|
||||||
isDemoMode = false
|
isDemoMode = false
|
||||||
batchSize = 100
|
batchSize = 100
|
||||||
|
@ -59,7 +59,7 @@ func isIpAddress(host string) bool {
|
|||||||
return ip != nil
|
return ip != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getOriginFromHost(host string) (string, string) {
|
func getOriginFromHostInternal(host string) (string, string) {
|
||||||
origin := conf.GetConfigString("origin")
|
origin := conf.GetConfigString("origin")
|
||||||
if origin != "" {
|
if origin != "" {
|
||||||
return origin, origin
|
return origin, origin
|
||||||
@ -82,6 +82,17 @@ func getOriginFromHost(host string) (string, string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getOriginFromHost(host string) (string, string) {
|
||||||
|
originF, originB := getOriginFromHostInternal(host)
|
||||||
|
|
||||||
|
originFrontend := conf.GetConfigString("originFrontend")
|
||||||
|
if originFrontend != "" {
|
||||||
|
originF = originFrontend
|
||||||
|
}
|
||||||
|
|
||||||
|
return originF, originB
|
||||||
|
}
|
||||||
|
|
||||||
func GetOidcDiscovery(host string) OidcDiscovery {
|
func GetOidcDiscovery(host string) OidcDiscovery {
|
||||||
originFrontend, originBackend := getOriginFromHost(host)
|
originFrontend, originBackend := getOriginFromHost(host)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user