mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
feat: add fields like Email to user profile in JWT-Empty mode
This commit is contained in:
parent
988b14c6b5
commit
ea2f053630
@ -34,6 +34,12 @@ type Claims struct {
|
|||||||
type UserShort struct {
|
type UserShort struct {
|
||||||
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
|
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
|
||||||
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
||||||
|
|
||||||
|
Id string `xorm:"varchar(100) index" json:"id"`
|
||||||
|
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||||
|
Avatar string `xorm:"varchar(500)" json:"avatar"`
|
||||||
|
Email string `xorm:"varchar(100) index" json:"email"`
|
||||||
|
Phone string `xorm:"varchar(20) index" json:"phone"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserWithoutThirdIdp struct {
|
type UserWithoutThirdIdp struct {
|
||||||
@ -144,6 +150,12 @@ func getShortUser(user *User) *UserShort {
|
|||||||
res := &UserShort{
|
res := &UserShort{
|
||||||
Owner: user.Owner,
|
Owner: user.Owner,
|
||||||
Name: user.Name,
|
Name: user.Name,
|
||||||
|
|
||||||
|
Id: user.Id,
|
||||||
|
DisplayName: user.DisplayName,
|
||||||
|
Avatar: user.Avatar,
|
||||||
|
Email: user.Email,
|
||||||
|
Phone: user.Phone,
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user