Skip to content

Commit

Permalink
2fa email recovery fields
Browse files Browse the repository at this point in the history
  • Loading branch information
shoreward committed Mar 3, 2021
1 parent 6ac7874 commit de1a5f3
Showing 1 changed file with 73 additions and 13 deletions.
86 changes: 73 additions & 13 deletions tdapi/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,88 @@ type Auth struct {
Required2fa bool `json:"required2fa"`
}

type Auth2faForm struct {
Token string `json:"token"`
Password string `json:"password"`
type Auth2faSettingsResponse struct {
Enabled bool `json:"enabled"`
RecoveryStatus string `json:"recovery_status"`
}

type Auth2faSettingsResponse struct {
Enabled bool `json:"enabled"`
type Auth2faMailRecovery struct {
CodeValidUntil string `json:"code_valid_until"`
NextCodeAt string `json:"next_code_at"`
CodeLength int `json:"code_length"`
}

type Auth2faSettingsSetForm struct {
NewPassword string `json:"new_password"`
NewPasswordRepeat string `json:"new_password_repeat"`
Hint string `json:"hint"`
type Auth2faSettingsMailValidation struct {
Enabled bool `json:"enabled"`
RecoveryStatus string `json:"recovery_status"`

CodeValidUntil string `json:"code_valid_until"`
NextCodeAt string `json:"next_code_at"`
CodeLength int `json:"code_length"`
}

type Auth2faSettingsUpdateForm struct {
OldPassword string `json:"old_password"`
type basicPasswordUpdate struct {
NewPassword string `json:"new_password"`
NewPasswordRepeat string `json:"new_password_repeat"`
Hint string `json:"hint"`
}

type Auth2faSettingsDeleteForm struct {
OldPassword string `json:"old_password"`
type basicToken struct {
Token string `json:"token"`
}

type basicPassword struct {
Password string `json:"password"`
}

type basicEmail struct {
Email string `json:"email"`
}

type basicCode struct {
Code string `json:"code"`
}

type Auth2faForm struct {
basicToken
basicPassword
}

type Create2faPasswordForm struct {
basicPasswordUpdate
}

type Update2faPasswordForm struct {
basicPasswordUpdate
basicPassword
}

type Internal2faPasswordForm struct {
basicPassword
}

type SendMail2faConfirmForm struct {
basicPassword
basicEmail
}

type ConfirmMail2faForm struct {
basicPassword
basicCode
basicEmail
}

type AuthToken2faForm struct {
basicToken
}

type AuthCheckCode2faForm struct {
basicToken
basicCode
}

type AuthPasswordRecovery2faForm struct {
basicPasswordUpdate
basicToken
basicCode
}

0 comments on commit de1a5f3

Please sign in to comment.