Skip to content

Commit 58b204b

Browse files
authored
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).
1 parent 6ba0c37 commit 58b204b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

modules/structs/user.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ type User struct {
2020
// the user's authentication sign-in name.
2121
// default: empty
2222
LoginName string `json:"login_name"`
23+
// The ID of the user's Authentication Source
24+
SourceID int64 `json:"source_id"`
2325
// the user's full name
2426
FullName string `json:"full_name"`
2527
// swagger:strfmt email

services/convert/user.go

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func toUser(ctx context.Context, user *user_model.User, signed, authed bool) *ap
7575
if authed {
7676
result.IsAdmin = user.IsAdmin
7777
result.LoginName = user.LoginName
78+
result.SourceID = user.LoginSource
7879
result.LastLogin = user.LastLoginUnix.AsTime()
7980
result.Language = user.Language
8081
result.IsActive = user.IsActive

templates/swagger/v1_json.tmpl

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)