diff options
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r-- | modules/auth/auth.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 38980832..825bbd3c 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -8,6 +8,7 @@ import ( "net/http" "reflect" "strings" + "time" "github.com/Unknwon/com" "github.com/Unknwon/macaron" @@ -37,13 +38,17 @@ func SignedInId(req *http.Request, sess session.Store) int64 { if len(auHead) > 0 { auths := strings.Fields(auHead) if len(auths) == 2 && auths[0] == "token" { - t, err := models.GetAccessTokenBySha(auths[1]) + t, err := models.GetAccessTokenBySHA(auths[1]) if err != nil { if err != models.ErrAccessTokenNotExist { - log.Error(4, "GetAccessTokenBySha: %v", err) + log.Error(4, "GetAccessTokenBySHA: %v", err) } return 0 } + t.Updated = time.Now() + if err = models.UpdateAccessToekn(t); err != nil { + log.Error(4, "UpdateAccessToekn: %v", err) + } return t.UID } } |