Updated error response

This commit is contained in:
chopster44 committed 2023-07-16 17:33:51 +01:00
1 parent 95be6c0fca
commit a1fd8ea825
1 file changed
+2 -1
+2 -1
View File
@@ -46,6 +46,7 @@ func login(c *gin.Context) {
// get the username and password from the request // get the username and password from the request
var userData loginInput var userData loginInput
if err := c.BindJSON(&userData); err != nil { if err := c.BindJSON(&userData); err != nil {
c.IndentedJSON(http.StatusNotAcceptable, userData)
return return
} }
// check for user using given credentials // check for user using given credentials
@@ -61,7 +62,7 @@ func login(c *gin.Context) {
} }
if user.Password != userData.Password { if user.Password != userData.Password {
// user not real // user not real
c.IndentedJSON(http.StatusMethodNotAllowed, userData) c.IndentedJSON(http.StatusNotAcceptable, userData)
return return
} else { } else {
// user is in // user is in