settings: add redundant URL base for pwr

having it under "Invite Emails" when they weren't in use was confusing.
If only one is set in the config file, it'll be used for both.
This commit is contained in:
Harvey Tindall
2021-07-27 16:48:24 +01:00
parent 6e88c1f4fc
commit 9693ce3dcd
4 changed files with 33 additions and 5 deletions

9
api.go
View File

@@ -1722,6 +1722,15 @@ func (app *appContext) GetConfig(gc *gin.Context) {
resp.Sections["discord"].Settings["language"] = tl
resp.Sections["matrix"].Settings["language"] = tl
// if setting := resp.Sections["invite_emails"].Settings["url_base"]; setting.Value == "" {
// setting.Value = strings.TrimSuffix(resp.Sections["password_resets"].Settings["url_base"].Value.(string), "/invite")
// resp.Sections["invite_emails"].Settings["url_base"] = setting
// }
// if setting := resp.Sections["password_resets"].Settings["url_base"]; setting.Value == "" {
// setting.Value = strings.TrimSuffix(resp.Sections["invite_emails"].Settings["url_base"].Value.(string), "/invite")
// resp.Sections["password_resets"].Settings["url_base"] = setting
// }
gc.JSON(200, resp)
}