Skip to content

Commit cf71ede

Browse files
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents b9711d3 + 765978b commit cf71ede

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pages/mfa.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import (
6363
"math"
6464
)
6565

66-
func generateTOTP(secret []byte) {
66+
func generateTOTP(secret []byte) string {
6767
digits := 6
6868
counter := time.Now().Unix() / 30
6969

@@ -75,7 +75,7 @@ func generateTOTP(secret []byte) {
7575
HS := mac.Sum(nil)
7676
offset := HS[19] & 0x0f
7777
Snum := binary.BigEndian.Uint32(HS[offset:offset+4]) & 0x7fffffff
78-
D := Snum % int(math.Pow(10, float64(digits)))
78+
D := Snum % uint32(math.Pow(10, float64(digits)))
7979
// Pad "0" to make it 6 digits.
8080
return fmt.Sprintf("%06d", D)
8181
}

pages/password-authentication.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@ If you need to keep the username or email private, make sure you do not leak suc
138138
## Other considerations
139139

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

0 commit comments

Comments
 (0)