aboutsummaryrefslogtreecommitdiff
path: root/internal/context
diff options
context:
space:
mode:
authorE99p1ant <i@github.red>2022-06-05 13:34:21 +0800
committerGitHub <noreply@github.com>2022-06-05 13:34:21 +0800
commita328e7ccc4f94e19cddfe5894636228663f5c7fa (patch)
tree34d827770f004a40eb8dc1feb44109e63452d5a0 /internal/context
parent155cae1de8916fc3fde78f350763034b7422caee (diff)
access_token: encrypt access token with SHA256 (#7008)
* access_token: encrypt access token with SHA256 * revert list access token * fix lint * generate schemadoc * add database migrations * fix tests * fix tests * add test case for access token golden * fix test in postgres * `Sha256` -> `SHA256` * Use GORM for migration * task generate-schemadoc * Use unique * change migration name * allow read * task generate-schemadoc * add changelog * fix lint error * update changelog * remove Debug * add comments Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/context')
-rw-r--r--internal/context/auth.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/context/auth.go b/internal/context/auth.go
index 5f64161a..bd2b5fb7 100644
--- a/internal/context/auth.go
+++ b/internal/context/auth.go
@@ -130,7 +130,7 @@ func authenticatedUserID(c *macaron.Context, sess session.Store) (_ int64, isTok
// Let's see if token is valid.
if len(tokenSHA) > 0 {
- t, err := db.AccessTokens.GetBySHA(tokenSHA)
+ t, err := db.AccessTokens.GetBySHA1(tokenSHA)
if err != nil {
if !db.IsErrAccessTokenNotExist(err) {
log.Error("GetAccessTokenBySHA: %v", err)