Fail if there is an error retrieving the user + extra test (#142)

Previously this would fail, but permit the request, which isn't
normally what you'd want.
This commit is contained in:
Thom Seddon
2020-06-29 21:02:45 +01:00
committed by GitHub
parent be2b4ba9f4
commit 870724c994
2 changed files with 73 additions and 1 deletions

View File

@ -167,6 +167,7 @@ func (s *Server) AuthCallbackHandler() http.HandlerFunc {
user, err := p.GetUser(token)
if err != nil {
logger.WithField("error", err).Error("Error getting user")
http.Error(w, "Service unavailable", 503)
return
}