finishing up the basic implementation of comments

This commit is contained in:
2017-09-06 09:01:35 -05:00
parent 28c081ed30
commit 1f3d3a21d2
2 changed files with 6 additions and 9 deletions
+1
View File
@@ -68,6 +68,7 @@ func (cs *Service) User(r *http.Request) (string, bool) {
func (cs *Service) ServeComments(post string, w http.ResponseWriter, r *http.Request) error {
user, allowed := cs.User(r)
if !allowed {
fmt.Fprintf(w, "<a href='/login'>click here to enter your name and the comments password</a>")
w.WriteHeader(401)
return nil
}