Treat fediverse usernames as case-insensitive (#2155)

* treat fediverse usernames as case-insensitive for auth

* add test for case insensitive, clean up duplicate import in federverse auth controller

* fix test, there was an issue with state when all the tests were run
This commit is contained in:
Matt Owens
2022-10-02 14:16:46 -04:00
committed by GitHub
parent 2ff5f31597
commit e20985ecb4
3 changed files with 22 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package fediverse
import (
"crypto/rand"
"io"
"strings"
"time"
)
@@ -37,7 +38,7 @@ func RegisterFediverseOTP(accessToken, userID, userDisplayName, account string)
Code: code,
UserID: userID,
UserDisplayName: userDisplayName,
Account: account,
Account: strings.ToLower(account),
Timestamp: time.Now(),
}
pendingAuthRequests[accessToken] = r