Skip to content

Commit dcd0fb3

Browse files
committed
Adding struct
1 parent 8c41cc7 commit dcd0fb3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

auth/user_mgt.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,17 @@ type multiFactorInfoResponse struct {
7070
EnrolledAt string `json:"enrolledAt,omitempty"`
7171
}
7272

73-
// TOTPInfo describes a user enrolled second totp factor.
73+
// TOTPInfo describes a server side user enrolled second totp factor.
7474
type TOTPInfo struct{}
7575

7676
// PhoneMultiFactorInfo describes a user enrolled second phone factor.
7777
type PhoneMultiFactorInfo struct {
7878
PhoneNumber string
7979
}
8080

81+
// PhoneMultiFactorInfo describes a user enrolled second totp factor.
82+
type TOTPMultiFactorInfo struct{}
83+
8184
type multiFactorEnrollments struct {
8285
Enrollments []*multiFactorInfoResponse `json:"enrollments"`
8386
}
@@ -89,7 +92,7 @@ type MultiFactorInfo struct {
8992
EnrollmentTimestamp int64
9093
FactorID string
9194
PhoneMultiFactorInfo *PhoneMultiFactorInfo
92-
TOTPMultiFactorInfo *TOTPInfo
95+
TOTPMultiFactorInfo *TOTPMultiFactorInfo
9396
}
9497

9598
// MultiFactorSettings describes the multi-factor related user settings.
@@ -1112,7 +1115,7 @@ func (r *userQueryResponse) makeExportedUserRecord() (*ExportedUserRecord, error
11121115
DisplayName: factor.DisplayName,
11131116
EnrollmentTimestamp: enrollmentTimestamp,
11141117
FactorID: totpMultiFactorID,
1115-
TOTPMultiFactorInfo: &TOTPInfo{},
1118+
TOTPMultiFactorInfo: &TOTPMultiFactorInfo{},
11161119
})
11171120
} else {
11181121
return nil, fmt.Errorf("unsupported multi-factor auth response: %#v", factor)

auth/user_mgt_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var testUser = &UserRecord{
8181
UID: "enrolledTOTPFactor",
8282
FactorID: "totp",
8383
EnrollmentTimestamp: 1614776780000,
84-
TOTPMultiFactorInfo: &TOTPInfo{},
84+
TOTPMultiFactorInfo: &TOTPMultiFactorInfo{},
8585
DisplayName: "My MFA TOTP",
8686
},
8787
},

0 commit comments

Comments
 (0)