From 29b44015fd4d3d8589be33beabb1a55b23115e55 Mon Sep 17 00:00:00 2001 From: Kirill Zaitsev Date: Wed, 29 Apr 2015 03:05:16 +0300 Subject: [PATCH] Fix token problems at first login --- plugin/remote/gitlab/gitlab.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/remote/gitlab/gitlab.go b/plugin/remote/gitlab/gitlab.go index 69b50b34f..f2e8834ce 100644 --- a/plugin/remote/gitlab/gitlab.go +++ b/plugin/remote/gitlab/gitlab.go @@ -268,7 +268,8 @@ func (r *Gitlab) OpenRegistration() bool { func (r *Gitlab) GetToken(user *model.User) (*model.Token, error) { expiry := time.Unix(user.TokenExpiry, 0) - if user.TokenExpiry == 0 || expiry.Sub(time.Now()) > (60*time.Second) { + if user.TokenExpiry == 0 && len(user.Access) != 0 || + expiry.Sub(time.Now()) > (60*time.Second) { return nil, nil }