Added new checks (#2)
* added gocyclo-check * Added new tests to drone * Added new checks to makefile
This commit is contained in:
@ -30,6 +30,9 @@ func UserChangePassword(c echo.Context) error {
|
||||
|
||||
// Check if the user is itself
|
||||
userJWTinfo, err := models.GetCurrentUser(c)
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusInternalServerError, models.Message{"Error getting current user."})
|
||||
}
|
||||
|
||||
if userJWTinfo.ID != userID {
|
||||
return echo.ErrUnauthorized
|
||||
|
Reference in New Issue
Block a user