package http import ( "framework_v2/consts" "framework_v2/internal/logic" "framework_v2/internal/providers/helper" "framework_v2/models" "github.com/gin-gonic/gin" "net/http" ) func RequireJWTIDToken(c *gin.Context) { auth := logic.NewAuthLogic() user, err := auth.GinMiddlewareAuth(models.JWTIDToken, c) if err != nil { c.Abort() helper.ResponseError(c, http.StatusUnauthorized, err) return } c.Set(consts.AuthMiddlewareKey, user) c.Next() }