summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-19 06:22:33 +0800
committerUnknwon <u@gogs.io>2015-08-19 06:22:33 +0800
commit03b85b73af03eae98308fc3d36cdbd47db1503d6 (patch)
tree686f7e0c63c274c168718ee8d06b1431a8e8ed44 /routers
parent54b52de6eed4eb2f76620c48189ba3167c290121 (diff)
downloadgitea-03b85b73af03eae98308fc3d36cdbd47db1503d6.tar.gz
gitea-03b85b73af03eae98308fc3d36cdbd47db1503d6.zip
token recent activity
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/http.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 4d86f39260..9c1f227391 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -113,7 +113,7 @@ func Http(ctx *middleware.Context) {
}
// Assume username now is a token.
- token, err := models.GetAccessTokenBySha(authUsername)
+ token, err := models.GetAccessTokenBySHA(authUsername)
if err != nil {
if err == models.ErrAccessTokenNotExist {
ctx.HandleText(401, "invalid token")
@@ -122,6 +122,10 @@ func Http(ctx *middleware.Context) {
}
return
}
+ token.Updated = time.Now()
+ if err = models.UpdateAccessToekn(token); err != nil {
+ ctx.Handle(500, "UpdateAccessToekn", err)
+ }
authUser, err = models.GetUserByID(token.UID)
if err != nil {
ctx.Handle(500, "GetUserById", err)