mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
pwr: allow jellyfin pwrs when not using email
switched if !emailEnabled { return } to if !messagesEnabled { return }.
Fixes #439.
This commit is contained in:
@@ -278,7 +278,8 @@ const (
|
|||||||
// NOTE: "migrations.go" is the one file where log messages are not part of logmessages/logmessages.go.
|
// NOTE: "migrations.go" is the one file where log messages are not part of logmessages/logmessages.go.
|
||||||
|
|
||||||
// pwreset.go
|
// pwreset.go
|
||||||
PWRExpired = "PWR for user \"%s\" already expired @ %s, check system time!"
|
PWRExpired = "PWR for user \"%s\" already expired @ %s, check system time!"
|
||||||
|
NewPWRForUser = "New password reset for user \"%s\""
|
||||||
|
|
||||||
// router.go
|
// router.go
|
||||||
UseDefaultHTML = "Using default HTML \"%s\""
|
UseDefaultHTML = "Using default HTML \"%s\""
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ type PasswordReset struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func pwrMonitor(app *appContext, watcher *fsnotify.Watcher) {
|
func pwrMonitor(app *appContext, watcher *fsnotify.Watcher) {
|
||||||
if !emailEnabled {
|
if !messagesEnabled {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
@@ -94,7 +94,7 @@ func pwrMonitor(app *appContext, watcher *fsnotify.Watcher) {
|
|||||||
app.debug.Printf(lm.FailedReading, event.Name, err)
|
app.debug.Printf(lm.FailedReading, event.Name, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
app.info.Printf("New password reset for user \"%s\"", pwr.Username)
|
app.info.Printf(lm.NewPWRForUser, pwr.Username)
|
||||||
if currentTime := time.Now(); pwr.Expiry.After(currentTime) {
|
if currentTime := time.Now(); pwr.Expiry.After(currentTime) {
|
||||||
user, err := app.jf.UserByName(pwr.Username, false)
|
user, err := app.jf.UserByName(pwr.Username, false)
|
||||||
if err != nil || user.ID == "" {
|
if err != nil || user.ID == "" {
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ export class ProfileEditor {
|
|||||||
const editor = document.createElement("code-input") as CodeInput;
|
const editor = document.createElement("code-input") as CodeInput;
|
||||||
editor.setAttribute("template", "json-highlighted");
|
editor.setAttribute("template", "json-highlighted");
|
||||||
editor.setAttribute("language", "json");
|
editor.setAttribute("language", "json");
|
||||||
editor.classList.add("rounded-sm");
|
editor.classList.add("rounded-md");
|
||||||
editor.value = JSON.stringify(req.response, null, 2);
|
editor.value = JSON.stringify(req.response, null, 2);
|
||||||
editorContainer.replaceChildren(editor);
|
editorContainer.replaceChildren(editor);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user