fix(util): directly pass code, ticket to data struct
This commit is contained in:
parent
512db258d5
commit
88e27fa413
1 changed files with 2 additions and 5 deletions
|
|
@ -129,13 +129,10 @@ func Login(s *discordgo.Session, email, password string) (*loginResponse, error)
|
|||
// TOTP creates a new request to `/mfa/totp` endpoint for time-based one-time
|
||||
// passcode for essential login information
|
||||
func TOTP(s *discordgo.Session, code, ticket string) (*loginResponse, error) {
|
||||
var data struct {
|
||||
data := struct {
|
||||
Code string `json:"code"`
|
||||
Ticket string `json:"ticket"`
|
||||
}
|
||||
data.Code = code
|
||||
data.Ticket = ticket
|
||||
|
||||
}{code, ticket}
|
||||
e := discordgo.EndpointAuth + "mfa/totp"
|
||||
resp, err := s.RequestWithBucketID("POST", e, data, e)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue