diff options
Diffstat (limited to 'routers/user/oauth.go')
-rw-r--r-- | routers/user/oauth.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/user/oauth.go b/routers/user/oauth.go index 924bac8ef6..19add5e647 100644 --- a/routers/user/oauth.go +++ b/routers/user/oauth.go @@ -7,7 +7,6 @@ package user import ( "encoding/base64" "fmt" - "github.com/go-macaron/binding" "net/url" "strings" @@ -17,9 +16,10 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" - "code.gitea.io/gitea/modules/util" + "code.gitea.io/gitea/modules/timeutil" "github.com/dgrijalva/jwt-go" + "github.com/go-macaron/binding" ) const ( @@ -118,7 +118,7 @@ func newAccessTokenResponse(grant *models.OAuth2Grant) (*AccessTokenResponse, *A } } // generate access token to access the API - expirationDate := util.TimeStampNow().Add(setting.OAuth2.AccessTokenExpirationTime) + expirationDate := timeutil.TimeStampNow().Add(setting.OAuth2.AccessTokenExpirationTime) accessToken := &models.OAuth2Token{ GrantID: grant.ID, Type: models.TypeAccessToken, @@ -135,7 +135,7 @@ func newAccessTokenResponse(grant *models.OAuth2Grant) (*AccessTokenResponse, *A } // generate refresh token to request an access token after it expired later - refreshExpirationDate := util.TimeStampNow().Add(setting.OAuth2.RefreshTokenExpirationTime * 60 * 60).AsTime().Unix() + refreshExpirationDate := timeutil.TimeStampNow().Add(setting.OAuth2.RefreshTokenExpirationTime * 60 * 60).AsTime().Unix() refreshToken := &models.OAuth2Token{ GrantID: grant.ID, Counter: grant.Counter, |