Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Dec 9, 2024
2 parents b9711d3 + 765978b commit cf71ede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/mfa.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import (
"math"
)

func generateTOTP(secret []byte) {
func generateTOTP(secret []byte) string {
digits := 6
counter := time.Now().Unix() / 30

Expand All @@ -75,7 +75,7 @@ func generateTOTP(secret []byte) {
HS := mac.Sum(nil)
offset := HS[19] & 0x0f
Snum := binary.BigEndian.Uint32(HS[offset:offset+4]) & 0x7fffffff
D := Snum % int(math.Pow(10, float64(digits)))
D := Snum % uint32(math.Pow(10, float64(digits)))
// Pad "0" to make it 6 digits.
return fmt.Sprintf("%06d", D)
}
Expand Down
1 change: 1 addition & 0 deletions pages/password-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,6 @@ If you need to keep the username or email private, make sure you do not leak suc
## Other considerations

- Do not prevent users from copy-pasting passwords as it discourages users from using password managers.
- Do not require users to change passwords periodically.
- Ask for the current password when a user attempts to change their password.
- [Open redirect](/open-redirect).

0 comments on commit cf71ede

Please sign in to comment.