feature (plg_backend_local): enable a fast path

This commit is contained in:
MickaelK
2026-07-10 11:00:17 +10:00
parent 02db3f3e6e
commit 080a8fcc09
+3 -3
View File
@@ -17,13 +17,13 @@ type Local struct {
}
func (this Local) Init(params map[string]string, app *App) (IBackend, error) {
if err := bcrypt.CompareHashAndPassword(
if this.secret != "" && params["password"] == this.secret {
return &Local{}, nil
} else if err := bcrypt.CompareHashAndPassword(
[]byte(Config.Get("auth.admin").String()),
[]byte(params["password"]),
); err == nil {
return &Local{}, nil
} else if this.secret != "" && params["password"] == this.secret {
return &Local{}, nil
}
return nil, ErrAuthenticationFailed
}