-
Notifications
You must be signed in to change notification settings - Fork 2
/
auth.go
57 lines (47 loc) · 1.41 KB
/
auth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package revoltgo
type LoginResponse struct {
Result string `json:"result"`
ID string `json:"_id"`
UserID string `json:"user_id"`
Token string `json:"token"`
Name string `json:"name"`
Subscription LoginResponseSubscription `json:"subscription"`
}
type LoginResponseSubscription struct {
Endpoint string `json:"endpoint"`
P256DH string `json:"p256dh"`
Auth string `json:"auth"`
}
type Sessions struct {
ID string `json:"_id"`
Name string `json:"name"`
}
type Account struct {
ID string `json:"_id"`
Email string `json:"email"`
}
type Onboarding struct {
Onboarding bool `json:"onboarding"`
}
type MFA struct {
// Unvalidated or authorised MFA ticket; used to resolve the correct account
MfaTicket string `json:"mfa_ticket"`
// MFA response
MfaResponse MFAResponse `json:"mfa_response"`
// Friendly name used for the session
FriendlyName string `json:"friendly_name"`
}
type MFAResponse struct {
Password string `json:"password"`
}
type ChangeEmail struct {
Ticket Ticket `json:"ticket"` // Why is this nested
}
type Ticket struct {
ID string `json:"_id"`
AccountID string `json:"account_id"`
Token string `json:"token"`
Validated bool `json:"validated"`
Authorised bool `json:"authorised"`
LastTOTPCode string `json:"last_totp_code"`
}