Skip to content

Commit

Permalink
Merge branch 'feat/coupon' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sjatsh committed Nov 8, 2023
2 parents 5e895c6 + 985a361 commit bac97b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions http_server/handle/check_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func (h *HttpHandle) CheckPermissions(ctx *gin.Context) {

claims := &Claims{}
tkn, err := jwt.ParseWithClaims(tokenVal, claims, func(token *jwt.Token) (any, error) {
return config.Cfg.Das.JwtKey, nil
})
return []byte(config.Cfg.Das.JwtKey), nil
}, jwt.WithValidMethods([]string{jwt.SigningMethodHS256.Name}))
if err != nil {
if errors.Is(err, jwt.ErrSignatureInvalid) {
apiResp.ApiRespErr(api_code.ApiCodeUnauthorized, "unauthorized")
Expand Down
2 changes: 1 addition & 1 deletion http_server/handle/sign_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (h *HttpHandle) doSignIn(ctx *gin.Context, req *ReqSignIn, apiResp *api_cod
}

token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
tokenString, err := token.SignedString(config.Cfg.Das.JwtKey)
tokenString, err := token.SignedString([]byte(config.Cfg.Das.JwtKey))
if err != nil {
apiResp.ApiRespErr(api_code.ApiCodeError500, "internal error")
return err
Expand Down

0 comments on commit bac97b1

Please sign in to comment.