Added auth opportunity for VK callback API
This commit is contained in:
parent
657f967a49
commit
e4c2d9673b
3 changed files with 9 additions and 4 deletions
|
|
@ -7,12 +7,15 @@ import (
|
|||
)
|
||||
|
||||
func HandleMessage(c *gin.Context) {
|
||||
defer c.String(http.StatusOK, "ok")
|
||||
var req MessageRequest
|
||||
c.BindJSON(&req)
|
||||
if (req.Type == "confirmation") && (req.GroupId == GROUPID) {
|
||||
c.String(http.StatusOK, CONFIRMATION_STRING)
|
||||
}
|
||||
if req.Secret != SECRET_KEY {
|
||||
return
|
||||
}
|
||||
cardName := cardsinfo.GetOriginalName(req.Object.Body)
|
||||
Message(req.Object.UserId, cardName)
|
||||
c.String(http.StatusOK, "ok")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue