Rearrange setting frontend url in config

This commit is contained in:
kolaente 2021-05-28 08:46:31 +02:00
parent afd6bde74d
commit df45675df3
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -361,6 +361,10 @@ func InitConfig() {
RateLimitStore.Set(KeyvalueType.GetString()) RateLimitStore.Set(KeyvalueType.GetString())
} }
if ServiceFrontendurl.GetString() != "" && !strings.HasSuffix(ServiceFrontendurl.GetString(), "/") {
ServiceFrontendurl.Set(ServiceFrontendurl.GetString() + "/")
}
if AuthOpenIDRedirectURL.GetString() == "" { if AuthOpenIDRedirectURL.GetString() == "" {
AuthOpenIDRedirectURL.Set(ServiceFrontendurl.GetString() + "auth/openid/") AuthOpenIDRedirectURL.Set(ServiceFrontendurl.GetString() + "auth/openid/")
} }
@ -378,10 +382,6 @@ func InitConfig() {
MetricsEnabled.Set(true) MetricsEnabled.Set(true)
} }
if ServiceFrontendurl.GetString() != "" && !strings.HasSuffix(ServiceFrontendurl.GetString(), "/") {
ServiceFrontendurl.Set(ServiceFrontendurl.GetString() + "/")
}
log.Printf("Using config file: %s", viper.ConfigFileUsed()) log.Printf("Using config file: %s", viper.ConfigFileUsed())
} }