mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-01-03 23:10:11 +00:00
Compare commits
2 Commits
d81679fbae
...
e6cc7fce1a
Author | SHA1 | Date | |
---|---|---|---|
e6cc7fce1a | |||
d8b1f03ac4 |
@ -39,6 +39,8 @@ func (app *appContext) loadConfig() error {
|
||||
|
||||
app.MustSetValue("jellyfin", "public_server", app.config.Section("jellyfin").Key("server").String())
|
||||
|
||||
app.MustSetValue("ui", "redirect_url", app.config.Section("jellyfin").Key("public_server").String())
|
||||
|
||||
for _, key := range app.config.Section("files").Keys() {
|
||||
if name := key.Name(); name != "html_templates" && name != "lang_files" {
|
||||
key.SetValue(key.MustString(filepath.Join(app.dataPath, (key.Name() + ".json"))))
|
||||
@ -157,6 +159,11 @@ func (app *appContext) loadConfig() error {
|
||||
|
||||
substituteStrings = app.config.Section("jellyfin").Key("substitute_jellyfin_strings").MustString("")
|
||||
|
||||
if substituteStrings != "" {
|
||||
v := app.config.Section("ui").Key("success_message")
|
||||
v.SetValue(strings.ReplaceAll(v.String(), "Jellyfin", substituteStrings))
|
||||
}
|
||||
|
||||
oldFormLang := app.config.Section("ui").Key("language").MustString("")
|
||||
if oldFormLang != "" {
|
||||
app.storage.lang.chosenFormLang = oldFormLang
|
||||
|
@ -247,6 +247,15 @@
|
||||
"type": "text",
|
||||
"value": "",
|
||||
"description": "URL base for when running jfa-go with a reverse proxy in a subfolder. include preceding /, e.g \"/accounts\"."
|
||||
},
|
||||
"redirect_url": {
|
||||
"name": "Form success redirect URL",
|
||||
"required": false,
|
||||
"requires_restart": false,
|
||||
"type": "text",
|
||||
"value": "",
|
||||
"advanced": true,
|
||||
"description": "Set a different URL for the sign-up form to redirect the user to when they've signed up. Default to 'Public Server' or 'Server' in the Jellyfin tab."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
6
views.go
6
views.go
@ -160,7 +160,7 @@ func (app *appContext) ResetPassword(gc *gin.Context) {
|
||||
if isInternal && setPassword {
|
||||
data["helpMessage"] = app.config.Section("ui").Key("help_message").String()
|
||||
data["successMessage"] = app.config.Section("ui").Key("success_message").String()
|
||||
data["jfLink"] = app.config.Section("jellyfin").Key("public_server").String()
|
||||
data["jfLink"] = app.config.Section("ui").Key("redirect_url").String()
|
||||
data["validate"] = app.config.Section("password_validation").Key("enabled").MustBool(false)
|
||||
data["requirements"] = app.validator.getCriteria()
|
||||
data["strings"] = app.storage.lang.PasswordReset[lang].Strings
|
||||
@ -313,7 +313,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
|
||||
"strings": app.storage.lang.Form[lang].Strings,
|
||||
"successMessage": app.config.Section("ui").Key("success_message").String(),
|
||||
"contactMessage": app.config.Section("ui").Key("contact_message").String(),
|
||||
"jfLink": app.config.Section("jellyfin").Key("public_server").String(),
|
||||
"jfLink": app.config.Section("ui").Key("redirect_url").String(),
|
||||
})
|
||||
inv, ok := app.storage.invites[code]
|
||||
if ok {
|
||||
@ -337,7 +337,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
|
||||
"contactMessage": app.config.Section("ui").Key("contact_message").String(),
|
||||
"helpMessage": app.config.Section("ui").Key("help_message").String(),
|
||||
"successMessage": app.config.Section("ui").Key("success_message").String(),
|
||||
"jfLink": app.config.Section("jellyfin").Key("public_server").String(),
|
||||
"jfLink": app.config.Section("ui").Key("redirect_url").String(),
|
||||
"validate": app.config.Section("password_validation").Key("enabled").MustBool(false),
|
||||
"requirements": app.validator.getCriteria(),
|
||||
"email": email,
|
||||
|
Loading…
Reference in New Issue
Block a user