Added Flags

This commit is contained in:
Pablu23
2024-05-22 23:00:50 +02:00
parent f905d482a5
commit a2232026a0
4 changed files with 38 additions and 22 deletions

View File

@@ -11,7 +11,7 @@ func (s *Server) Auth(next http.Handler) http.Handler {
next.ServeHTTP(w, r)
return
}
if cookie != nil && cookie.Value == s.secret {
if s.secret == "" || (cookie != nil && cookie.Value == s.secret) {
next.ServeHTTP(w, r)
} else {
http.Redirect(w, r, "/login", http.StatusFound)