aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorTobias Balle-Petersen <tobiasbp@gmail.com>2024-04-16 08:08:48 +0200
committerGitHub <noreply@github.com>2024-04-16 06:08:48 +0000
commit58b204b813cd3a97db904d889d552e64a7e398ff (patch)
tree68143d772e1c9877272bb746fd62a06f6c6730eb /services
parent6ba0c371c21237376c292ee92ec067b4a1ef1218 (diff)
downloadgitea-58b204b813cd3a97db904d889d552e64a7e398ff.tar.gz
gitea-58b204b813cd3a97db904d889d552e64a7e398ff.zip
Update API to return 'source_id' for users (#29718)
Using the API, a user's _source_id_ can be set in the _CreateUserOption_ model, but the field is not returned in the _User_ model. This PR updates the _User_ model to include the field _source_id_ (The ID of the Authentication Source).
Diffstat (limited to 'services')
-rw-r--r--services/convert/user.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/services/convert/user.go b/services/convert/user.go
index 3521dd2f90..1a2733d91e 100644
--- a/services/convert/user.go
+++ b/services/convert/user.go
@@ -75,6 +75,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