diff --git a/modules/structs/user.go b/modules/structs/user.go index 82b565e5e..ad529c966 100644 --- a/modules/structs/user.go +++ b/modules/structs/user.go @@ -19,6 +19,8 @@ type User struct { // the user's authentication sign-in name. // default: empty LoginName string `json:"login_name"` + // The ID of the user's Authentication Source + SourceID int64 `json:"source_id"` // the user's full name FullName string `json:"full_name"` // swagger:strfmt email diff --git a/services/convert/user.go b/services/convert/user.go index 98db53705..789bc5109 100644 --- a/services/convert/user.go +++ b/services/convert/user.go @@ -76,6 +76,7 @@ func toUser(ctx context.Context, user *user_model.User, signed, authed bool) *ap if authed { result.IsAdmin = user.IsAdmin result.LoginName = user.LoginName + result.SourceID = user.LoginSource result.LastLogin = user.LastLoginUnix.AsTime() result.Language = user.Language result.IsActive = user.IsActive diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index cc4e50e60..c68a90a4c 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -24672,6 +24672,12 @@ "type": "boolean", "x-go-name": "Restricted" }, + "source_id": { + "description": "The ID of the user's Authentication Source", + "type": "integer", + "format": "int64", + "x-go-name": "SourceID" + }, "starred_repos_count": { "type": "integer", "format": "int64",