1
Fork 0

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).

(cherry picked from commit 58b204b813cd3a97db904d889d552e64a7e398ff)
This commit is contained in:
Tobias Balle-Petersen 2024-04-16 08:08:48 +02:00 committed by Gergely Nagy
parent 3662829cc9
commit 23f032eaa5
No known key found for this signature in database
3 changed files with 9 additions and 0 deletions

View file

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