Oops — don’t worry about genus for non soubrettes.

This commit is contained in:
Matthew Dillon 2015-01-11 17:40:43 -09:00
parent cbb45c3fd7
commit 8a72ecae69

View file

@ -104,7 +104,9 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
writeJSON(w, Error{errGenericError})
return
}
if mux.Vars(r)["genus"] != token.Claims["genus"] {
genus := mux.Vars(r)["genus"]
// We don't care about this if we aren't accessing one of the subrouter routes.
if genus != "" && genus != token.Claims["genus"] {
w.WriteHeader(http.StatusInternalServerError)
writeJSON(w, Error{errAccessDenied})
return