-
Notifications
You must be signed in to change notification settings - Fork 1
Misc cleanup #131
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
Misc cleanup #131
Conversation
|
jason-jackson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
| err := bcrypt.CompareHashAndPassword([]byte(k.HashedSecret), []byte(given)) | ||
| if err != nil { | ||
| return err | ||
| return fmt.Errorf("hash does not match plaintext (hash: %s) (plaintext: %v...): %w", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively (I'm fine with current):
| return fmt.Errorf("hash does not match plaintext (hash: %s) (plaintext: %v...): %w", | |
| return fmt.Errorf("hash `%s` does not match plaintext `%v...`: %w", |
| user, err := mfa.AuthenticateRequest(r) | ||
| if err != nil { | ||
| http.Error(w, fmt.Sprintf("unable to authenticate request: %s", err), http.StatusUnauthorized) | ||
| log.Printf("unable to authenticate request: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| log.Printf("unable to authenticate request: %s", err) | |
| log.Println("unable to authenticate request:", err) |



Fixed