mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 10:46:31 +00:00
Merge pull request #856 from Bugagazavr/gitlab-ouath
Refresh only expired tokens
This commit is contained in:
@@ -9,4 +9,5 @@ type Login struct {
|
||||
Secret string
|
||||
Name string
|
||||
Email string
|
||||
Expiry int64
|
||||
}
|
||||
|
@@ -1,11 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Token struct {
|
||||
AccessToken string
|
||||
RefreshToken string
|
||||
Expiry time.Time
|
||||
Expiry int64
|
||||
}
|
||||
|
@@ -5,21 +5,22 @@ import (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID int64 `meddler:"user_id,pk" json:"-"`
|
||||
Remote string `meddler:"user_remote" json:"remote"`
|
||||
Login string `meddler:"user_login" json:"login"`
|
||||
Access string `meddler:"user_access" json:"-"`
|
||||
Secret string `meddler:"user_secret" json:"-"`
|
||||
Name string `meddler:"user_name" json:"name"`
|
||||
Email string `meddler:"user_email" json:"email,omitempty"`
|
||||
Gravatar string `meddler:"user_gravatar" json:"gravatar"`
|
||||
Token string `meddler:"user_token" json:"-"`
|
||||
Admin bool `meddler:"user_admin" json:"admin"`
|
||||
Active bool `meddler:"user_active" json:"active"`
|
||||
Syncing bool `meddler:"user_syncing" json:"syncing"`
|
||||
Created int64 `meddler:"user_created" json:"created_at"`
|
||||
Updated int64 `meddler:"user_updated" json:"updated_at"`
|
||||
Synced int64 `meddler:"user_synced" json:"synced_at"`
|
||||
ID int64 `meddler:"user_id,pk" json:"-"`
|
||||
Remote string `meddler:"user_remote" json:"remote"`
|
||||
Login string `meddler:"user_login" json:"login"`
|
||||
Access string `meddler:"user_access" json:"-"`
|
||||
Secret string `meddler:"user_secret" json:"-"`
|
||||
Name string `meddler:"user_name" json:"name"`
|
||||
Email string `meddler:"user_email" json:"email,omitempty"`
|
||||
Gravatar string `meddler:"user_gravatar" json:"gravatar"`
|
||||
Token string `meddler:"user_token" json:"-"`
|
||||
Admin bool `meddler:"user_admin" json:"admin"`
|
||||
Active bool `meddler:"user_active" json:"active"`
|
||||
Syncing bool `meddler:"user_syncing" json:"syncing"`
|
||||
Created int64 `meddler:"user_created" json:"created_at"`
|
||||
Updated int64 `meddler:"user_updated" json:"updated_at"`
|
||||
Synced int64 `meddler:"user_synced" json:"synced_at"`
|
||||
TokenExpiry int64 `meddler:"user_access_expires" json:"-"`
|
||||
}
|
||||
|
||||
func NewUser(remote, login, email string) *User {
|
||||
|
Reference in New Issue
Block a user