diff --git a/server/user.go b/server/user.go index c984b3384..edf45ff22 100644 --- a/server/user.go +++ b/server/user.go @@ -1,11 +1,12 @@ package server import ( + "encoding/base32" "net/http" "github.com/gin-gonic/gin" + "github.com/gorilla/securecookie" - "github.com/drone/drone-exp/shared/crypto" "github.com/drone/drone/cache" "github.com/drone/drone/router/middleware/session" "github.com/drone/drone/shared/token" @@ -69,7 +70,9 @@ func PostToken(c *gin.Context) { func DeleteToken(c *gin.Context) { user := session.User(c) - user.Hash = crypto.Rand() + user.Hash = base32.StdEncoding.EncodeToString( + securecookie.GenerateRandomKey(32), + ) if err := store.UpdateUser(c, user); err != nil { c.String(500, "Error revoking tokens. %s", err) return