Remove error returns from crypto random helpers and callers (#37240)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
This commit is contained in:
@@ -51,10 +51,7 @@ func AddScratchHash(x *xorm.Engine) error {
|
||||
|
||||
for _, tfa := range tfas {
|
||||
// generate salt
|
||||
salt, err := util.CryptoRandomString(10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
salt := util.CryptoRandomString(10)
|
||||
tfa.ScratchSalt = salt
|
||||
tfa.ScratchHash = base.HashToken(tfa.ScratchToken, salt)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user