mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Use base32 for 2FA scratch token (#18384)
* Use base32 for 2FA scratch token * rename Secure* to Crypto*, add comments
This commit is contained in:
@@ -416,7 +416,7 @@ func RegisterOpenIDPost(ctx *context.Context) {
|
||||
if length < 256 {
|
||||
length = 256
|
||||
}
|
||||
password, err := util.RandomString(int64(length))
|
||||
password, err := util.CryptoRandomString(int64(length))
|
||||
if err != nil {
|
||||
ctx.RenderWithErr(err.Error(), tplSignUpOID, form)
|
||||
return
|
||||
|
@@ -337,7 +337,7 @@ func SettingsPost(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
remoteSuffix, err := util.RandomString(10)
|
||||
remoteSuffix, err := util.CryptoRandomString(10)
|
||||
if err != nil {
|
||||
ctx.ServerError("RandomString", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user