diff --git a/httphandlers/oauth2.go b/httphandlers/oauth2.go index 7615591..2dfefab 100644 --- a/httphandlers/oauth2.go +++ b/httphandlers/oauth2.go @@ -143,6 +143,7 @@ func validateToken(accessToken string, gin *gin.Context) bool { errMsg := make(map[string]string) errMsg["error"] = err.Error() gin.JSON(500, errMsg) + gin.Abort() return false } if response.StatusCode != 200 { @@ -150,6 +151,7 @@ func validateToken(accessToken string, gin *gin.Context) bool { errMsg := make(map[string]string) errMsg["error"] = fmt.Sprintf("Received response %i", response.StatusCode) gin.JSON(500, errMsg) + gin.Abort() return false } var respArr map[string]interface{} @@ -160,6 +162,7 @@ func validateToken(accessToken string, gin *gin.Context) bool { errMsg := make(map[string]string) errMsg["error"] = "Failed to parse auth server response" gin.JSON(500, errMsg) + gin.Abort() return false } if respArr["active"].(bool) == false { diff --git a/programs/loader.go b/programs/loader.go index e6f41ba..2bc8960 100644 --- a/programs/loader.go +++ b/programs/loader.go @@ -242,11 +242,13 @@ func Reload(id string) (err error) { err = errors.New("server does not exist") return } + logging.Infof("Reloading server %s", temp.Id()) //have to cast it for this to work program, _ := temp.(*ProgramData) newVersion, err := Load(id) if err != nil { + logging.Error("error reloading server", err) return }