mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-28 04:41:09 +00:00
Merge pull request #995 from Bugagazavr/gitlab-tokens-fix
Fix token problems at first login
This commit is contained in:
commit
758910cbca
1 changed files with 2 additions and 1 deletions
|
@ -268,7 +268,8 @@ func (r *Gitlab) OpenRegistration() bool {
|
||||||
|
|
||||||
func (r *Gitlab) GetToken(user *model.User) (*model.Token, error) {
|
func (r *Gitlab) GetToken(user *model.User) (*model.Token, error) {
|
||||||
expiry := time.Unix(user.TokenExpiry, 0)
|
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
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue