mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Add Active and ProhibitLogin to API (#15689)
* Added active and prohibit_login. * Do not omit fields for normal users.
This commit is contained in:
@@ -58,6 +58,8 @@ func toUser(user *models.User, signed, authed bool) *api.User {
|
||||
result.IsAdmin = user.IsAdmin
|
||||
result.LastLogin = user.LastLoginUnix.AsTime()
|
||||
result.Language = user.Language
|
||||
result.IsActive = user.IsActive
|
||||
result.ProhibitLogin = user.ProhibitLogin
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
@@ -33,6 +33,10 @@ type User struct {
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
// Is user restricted
|
||||
Restricted bool `json:"restricted"`
|
||||
// Is user active
|
||||
IsActive bool `json:"active"`
|
||||
// Is user login prohibited
|
||||
ProhibitLogin bool `json:"prohibit_login"`
|
||||
// the user's location
|
||||
Location string `json:"location"`
|
||||
// the user's website
|
||||
|
Reference in New Issue
Block a user