Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: face mfa filter #1588

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/auth/user_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (u *UserAuthClient) Authenticate(ctx context.Context) (user model.User, aut
return
}
unsupportedMfaTypes := map[string]bool{
"face": true,
"FACE": true,
}
if resp.Err != "" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To provide comprehensive recommendations:

Firstly, ensure the implementation matches the interface correctly; if unsupportedMfaTypes is intended to contain string boolean types, then use them properly. Secondly, consider using consistent indentation and spacing within the function blocks.

Potential issues or irregularities found:

  • The docstring seems unnecessary since it's not related to the current functionality of the Authenticate method which takes a channel argument instead of returning an error as shown in the original code snippet.

Optimization Suggestions:

None immediately evident from reviewing the sample provided.

For full review:

func (u *UserAuthClient) Authenticate(ctx context.Context, ch <-chan user.MFAInfoMessage) (user model.User, auto bool)

// ...
if resp.Err != "" {
    panic(err.Error())
}

return u.user(), true // Assuming 'true' should match with the expected result

This version fixes any apparent errors while suggesting better practices that could enhance readability and efficiency over the given code.

Expand Down