diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-04-14 09:41:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 09:41:54 +0800 |
commit | cb439a126aa6a2728e423bcfd0d5e948337b8ddb (patch) | |
tree | f7d09181fe5b96ea444f7544091673b3c668b9fe /internal/route/repo/tasks.go | |
parent | 659acd48b1a131476fd98a54604fa6416b1cef9d (diff) |
db: add tests for two factors (#6099)
* Rename to TwoFactors.Create
* Use GORM to execute queries
* TwoFactor.GetByUserID
* Add tests
* Fix failing tests
* Add MD5 tests
* Add tests for RandomChars
Diffstat (limited to 'internal/route/repo/tasks.go')
-rw-r--r-- | internal/route/repo/tasks.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/route/repo/tasks.go b/internal/route/repo/tasks.go index e06d3ee7..81e85e2a 100644 --- a/internal/route/repo/tasks.go +++ b/internal/route/repo/tasks.go @@ -10,8 +10,8 @@ import ( "gopkg.in/macaron.v1" log "unknwon.dev/clog/v2" + "gogs.io/gogs/internal/cryptoutil" "gogs.io/gogs/internal/db" - "gogs.io/gogs/internal/tool" ) func TriggerTask(c *macaron.Context) { @@ -39,7 +39,7 @@ func TriggerTask(c *macaron.Context) { // 🚨 SECURITY: No need to check existence of the repository if the client // can't even get the valid secret. Mostly likely not a legitimate request. - if secret != tool.MD5(owner.Salt) { + if secret != cryptoutil.MD5(owner.Salt) { c.Error(http.StatusBadRequest, "Invalid secret") return } |