mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-20 19:51:33 +00:00
20 lines
447 B
Go
20 lines
447 B
Go
package plg_security_authlock
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
. "github.com/mickael-kerjean/filestash/server/common"
|
|
)
|
|
|
|
func init() {
|
|
Hooks.Register.Middleware(func(next HandlerFunc) HandlerFunc {
|
|
return func(app *App, res http.ResponseWriter, req *http.Request) {
|
|
if req.Method == http.MethodPost && req.URL.Path == WithBase("/api/session") && PluginEnable() {
|
|
SendErrorResult(res, ErrNotFound)
|
|
return
|
|
}
|
|
next(app, res, req)
|
|
}
|
|
})
|
|
}
|