1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 00:50:12 +00:00

pwr: fix set password for jellyfin PWRs

This commit is contained in:
Harvey Tindall 2023-12-20 19:04:40 +00:00
parent 290d02d248
commit 83712a6937
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -280,7 +280,8 @@ func (app *appContext) ResetPassword(gc *gin.Context) {
"ombiEnabled": app.config.Section("ombi").Key("enabled").MustBool(false),
}
pwr, isInternal := app.internalPWRs[pin]
if isInternal && setPassword {
// if isInternal && setPassword {
if 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("ui").Key("redirect_url").String()
@ -324,7 +325,7 @@ func (app *appContext) ResetPassword(gc *gin.Context) {
var status int
var err error
var username string
if !isInternal {
if !isInternal && !setPassword {
resp, status, err = app.jf.ResetPassword(pin)
} else if time.Now().After(pwr.Expiry) {
app.debug.Printf("Ignoring PWR request due to expired internal PIN: %s", pin)