Added page protection and reauthentication tests
This commit is contained in:
@@ -11,6 +11,7 @@ func RequiresLogin(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
user := contexts.GetUser(r.Context())
|
||||
if user == nil {
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
page.Error(
|
||||
"401",
|
||||
"Unauthorized",
|
||||
|
||||
Reference in New Issue
Block a user