mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-11-16 15:27:54 +00:00
Make the lock work
There is a new config field: Authorization.Locked.
I am a little bit sorry for how actually the lock is implemented. I've added the check on almost every handler there is. Good luck maintaining that ❤️
This commit is contained in:
@@ -54,6 +54,9 @@ func handlerStyle(w http.ResponseWriter, rq *http.Request) {
|
||||
}
|
||||
|
||||
func handlerUserList(w http.ResponseWriter, rq *http.Request) {
|
||||
if shown := user.FromRequest(rq).ShowLockMaybe(w, rq); shown {
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", mime.TypeByExtension(".html"))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte(views.BaseHTML("User list", views.UserListHTML(), user.FromRequest(rq))))
|
||||
|
||||
Reference in New Issue
Block a user