You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-16 08:46:30 +02:00
removed import that was mistakenly auto-added
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/base32"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"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/cache"
|
||||||
"github.com/drone/drone/router/middleware/session"
|
"github.com/drone/drone/router/middleware/session"
|
||||||
"github.com/drone/drone/shared/token"
|
"github.com/drone/drone/shared/token"
|
||||||
@@ -69,7 +70,9 @@ func PostToken(c *gin.Context) {
|
|||||||
|
|
||||||
func DeleteToken(c *gin.Context) {
|
func DeleteToken(c *gin.Context) {
|
||||||
user := session.User(c)
|
user := session.User(c)
|
||||||
user.Hash = crypto.Rand()
|
user.Hash = base32.StdEncoding.EncodeToString(
|
||||||
|
securecookie.GenerateRandomKey(32),
|
||||||
|
)
|
||||||
if err := store.UpdateUser(c, user); err != nil {
|
if err := store.UpdateUser(c, user); err != nil {
|
||||||
c.String(500, "Error revoking tokens. %s", err)
|
c.String(500, "Error revoking tokens. %s", err)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user