mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-07-27 07:50:55 +00:00
Compare commits
2 commits
c12cbbd100
...
4662d7efbe
Author | SHA1 | Date | |
---|---|---|---|
|
4662d7efbe | ||
|
7824d15d26 |
28
api/login.go
28
api/login.go
|
@ -1,6 +1,9 @@
|
|||
package api
|
||||
|
||||
import "github.com/diamondburned/arikawa/v3/utils/httputil"
|
||||
import (
|
||||
"github.com/diamondburned/arikawa/v3/discord"
|
||||
"github.com/diamondburned/arikawa/v3/utils/httputil"
|
||||
)
|
||||
|
||||
var (
|
||||
EndpointAuth = Endpoint + "auth/"
|
||||
|
@ -8,12 +11,25 @@ var (
|
|||
EndpointTOTP = EndpointAuth + "mfa/totp"
|
||||
)
|
||||
|
||||
type LoginResponse struct {
|
||||
MFA bool `json:"mfa"`
|
||||
SMS bool `json:"sms"`
|
||||
Ticket string `json:"ticket"`
|
||||
type (
|
||||
LoginSettings struct {
|
||||
Locale discord.Language `json:"locale"`
|
||||
Theme string `json:"theme"`
|
||||
}
|
||||
|
||||
LoginResponse struct {
|
||||
UserID discord.UserID `json:"user_id"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
UserSettings LoginSettings `json:"user_settings"`
|
||||
RequiredActions []string `json:"required_actions"`
|
||||
|
||||
Ticket string `json:"ticket"`
|
||||
MFA bool `json:"mfa"`
|
||||
TOTP bool `json:"totp"`
|
||||
SMS bool `json:"sms"`
|
||||
Backup bool `json:"backup"`
|
||||
}
|
||||
)
|
||||
|
||||
// login is the user's email or E.164-formatted phone number
|
||||
func (c *Client) Login(login, password string) (*LoginResponse, error) {
|
||||
|
|
Loading…
Reference in a new issue