Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rita Zerrizuela <zeta@widcket.com>
  • Loading branch information
ewanharris and Widcket authored Dec 13, 2023
1 parent b5c2f29 commit 62f9bd3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions authentication/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (m *MFA) VerifyWithOTP(ctx context.Context, body mfa.VerifyWithOTPRequest,
return
}

// VerifyWithOOB verifies an MFA challenge using an out-of-band challenge (OOB), either Push notification,
// SMS, or Voice.
// VerifyWithOOB verifies an MFA challenge using an out-of-band challenge (OOB), either push notification,
// SMS, or voice.
//
// See: https://auth0.com/docs/api/authentication#verify-with-out-of-band-oob-
func (m *MFA) VerifyWithOOB(ctx context.Context, body mfa.VerifyWithOOBRequest, opts ...RequestOption) (t *oauth.TokenSet, err error) {
Expand Down
20 changes: 10 additions & 10 deletions authentication/mfa/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ import (
"github.com/auth0/go-auth0/authentication/oauth"
)

// ChallengeRequest defines the request body for requesting an MFA Challenge.
// ChallengeRequest defines the request body for requesting an MFA challenge.
type ChallengeRequest struct {
oauth.ClientAuthentication
// The token received from mfa_required error.
// The token received from the `mfa_required` error.
MFAToken string `json:"mfa_token,omitempty"`
// A whitespace-separated list of the challenges types accepted by your application.
// Accepted challenge types are oob or otp. Excluding this parameter means that your
// client application accepts all supported challenge type
// Accepted challenge types are "oob" or "otp". Excluding this parameter means that your
// client application accepts all supported challenge types.
ChallengeType string `json:"challenge_type,omitempty"`
// The ID of the authenticator to challenge. You can get the ID by querying the list of
// available authenticators for the user using `management.User.ListAuthenticationMethods`
// available authenticators for the user using `management.User.ListAuthenticationMethods`.
AuthenticatorID string `json:"authenticator_id,omitempty"`
}

// ChallengeResponse defines the response body when requesting an MFA Challenge.
// ChallengeResponse defines the response body when requesting an MFA challenge.
type ChallengeResponse struct {
// The type of challenge requested.
ChallengeType string `json:"challenge_type,omitempty"`
// The OOB code to use when calling `VerifyWithOOBRequest`
// Only present when ChallengeType is "oob".
// Only present when `ChallengeType` is "oob".
OOBCode string `json:"oob_code,omitempty"`
/// If included, then the user should be prompted for a `BindingCode` which should be included
// in the VerifyWithOOBRequest provided to VerifyWithOOB.
// Only present when ChallengeType is "oob".
// in the `VerifyWithOOBRequest` provided to `VerifyWithOOB`.
// Only present when `ChallengeType` is "oob".
BindingMethod string `json:"binding_method,omitempty"`
}

Expand All @@ -38,7 +38,7 @@ type VerifyWithOTPRequest struct {
OTP string
}

// VerifyWithOOBRequest defines the request body for verifying an MFA challenge with oob.
// VerifyWithOOBRequest defines the request body for verifying an MFA challenge with an OOB challenge.
type VerifyWithOOBRequest struct {
oauth.ClientAuthentication
MFAToken string
Expand Down

0 comments on commit 62f9bd3

Please sign in to comment.