summaryrefslogtreecommitdiffstats
path: root/models/token.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-06-18 17:18:44 +0800
committerGitHub <noreply@github.com>2020-06-18 17:18:44 +0800
commit1dd3f19ee381d3a3554828a37282fd75ba3073ee (patch)
treef3ef01fcc5825e28b2e57d8da8c491555ef15fe4 /models/token.go
parent03ba974481296b76f87cbd756e41ecf5be9d006b (diff)
downloadgitea-1dd3f19ee381d3a3554828a37282fd75ba3073ee.tar.gz
gitea-1dd3f19ee381d3a3554828a37282fd75ba3073ee.zip
Use google/uuid to instead satori/go.uuid (#11943)
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/token.go')
-rw-r--r--models/token.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/token.go b/models/token.go
index 71a9f0975f..a18f15f325 100644
--- a/models/token.go
+++ b/models/token.go
@@ -13,7 +13,7 @@ import (
"code.gitea.io/gitea/modules/generate"
"code.gitea.io/gitea/modules/timeutil"
- gouuid "github.com/satori/go.uuid"
+ gouuid "github.com/google/uuid"
)
// AccessToken represents a personal access token.
@@ -45,7 +45,7 @@ func NewAccessToken(t *AccessToken) error {
return err
}
t.TokenSalt = salt
- t.Token = base.EncodeSha1(gouuid.NewV4().String())
+ t.Token = base.EncodeSha1(gouuid.New().String())
t.TokenHash = hashToken(t.Token, t.TokenSalt)
t.TokenLastEight = t.Token[len(t.Token)-8:]
_, err = x.Insert(t)