Merge pull request #995 from Bugagazavr/gitlab-tokens-fix

Fix token problems at first login
This commit is contained in:
Brad Rydzewski 2015-04-28 17:19:51 -07:00
commit 758910cbca

View file

@ -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
}