Skip to content

Commit

Permalink
api: csrf token
Browse files Browse the repository at this point in the history
  • Loading branch information
lz1998 committed Apr 3, 2021
1 parent 6b1e913 commit 7c060c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions service/bot/api_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,12 @@ func GetCookiesWithDomain(c *client.QQClient, domain string) string
func HandleGetCookies(cli *client.QQClient, req *onebot.GetCookiesReq) *onebot.GetCookiesResp {
return &onebot.GetCookiesResp{Cookies: GetCookiesWithDomain(cli, req.Domain)}
}

//go:linkname GetCSRFToken github.com/Mrs4s/MiraiGo/client.(*QQClient).getCSRFToken
func GetCSRFToken(c *client.QQClient) int

func HandleGetCSRFToken(cli *client.QQClient, req *onebot.GetCsrfTokenReq) *onebot.GetCsrfTokenResp {
return &onebot.GetCsrfTokenResp{
Token: int32(GetCSRFToken(cli)),
}
}

0 comments on commit 7c060c0

Please sign in to comment.