Skip to content

Commit ecdf8ea

Browse files
author
Baekjun Kim
committed
Fix structure and comment
1 parent f4efad8 commit ecdf8ea

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

modules/convert/user.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@ func toUser(user *user_model.User, signed, authed bool) *api.User {
6363
StarredRepos: user.NumStars,
6464
}
6565

66-
if authed {
67-
result.LoginName = user.LoginName
68-
} else {
69-
result.LoginName = ""
70-
}
71-
7266
result.Visibility = user.Visibility.String()
7367

7468
// hide primary email if API caller is anonymous or user keep email private
@@ -79,6 +73,7 @@ func toUser(user *user_model.User, signed, authed bool) *api.User {
7973
// only site admin will get these information and possibly user himself
8074
if authed {
8175
result.IsAdmin = user.IsAdmin
76+
result.LoginName = user.LoginName
8277
result.LastLogin = user.LastLoginUnix.AsTime()
8378
result.Language = user.Language
8479
result.IsActive = user.IsActive

modules/structs/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type User struct {
1717
ID int64 `json:"id"`
1818
// the user's username
1919
UserName string `json:"login"`
20-
// the user's login name
20+
// the user's authentication sign-in name. default: empty
2121
LoginName string `json:"login_name"`
2222
// the user's full name
2323
FullName string `json:"full_name"`

0 commit comments

Comments
 (0)