Skip to content

Commit

Permalink
fix: allows unmarshalling of form-post-data in login handle (appleboy…
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy authored May 27, 2018
1 parent 6bd2595 commit 4eade89
Show file tree
Hide file tree
Showing 34 changed files with 1,064 additions and 230 deletions.
3 changes: 1 addition & 2 deletions auth_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"time"

"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"gopkg.in/dgrijalva/jwt-go.v3"
)

Expand Down Expand Up @@ -314,7 +313,7 @@ func (mw *GinJWTMiddleware) LoginHandler(c *gin.Context) {

var loginVals Login

if c.ShouldBindWith(&loginVals, binding.JSON) != nil {
if c.ShouldBind(&loginVals) != nil {
mw.unauthorized(c, http.StatusBadRequest, mw.HTTPStatusMessageFunc(ErrMissingLoginValues, c))
return
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/gin-gonic/gin/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4eade89

Please sign in to comment.