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 |
30
api/login.go
30
api/login.go
|
@ -1,6 +1,9 @@
|
||||||
package api
|
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 (
|
var (
|
||||||
EndpointAuth = Endpoint + "auth/"
|
EndpointAuth = Endpoint + "auth/"
|
||||||
|
@ -8,12 +11,25 @@ var (
|
||||||
EndpointTOTP = EndpointAuth + "mfa/totp"
|
EndpointTOTP = EndpointAuth + "mfa/totp"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LoginResponse struct {
|
type (
|
||||||
MFA bool `json:"mfa"`
|
LoginSettings struct {
|
||||||
SMS bool `json:"sms"`
|
Locale discord.Language `json:"locale"`
|
||||||
Ticket string `json:"ticket"`
|
Theme string `json:"theme"`
|
||||||
Token string `json:"token"`
|
}
|
||||||
}
|
|
||||||
|
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
|
// login is the user's email or E.164-formatted phone number
|
||||||
func (c *Client) Login(login, password string) (*LoginResponse, error) {
|
func (c *Client) Login(login, password string) (*LoginResponse, error) {
|
||||||
|
|
Loading…
Reference in a new issue