mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
feat: Revert "feat: fix OIDC address field" (#3020)
This reverts commit 2f48d457730ece630405b555ec9253333648df3a.
This commit is contained in:
parent
2f48d45773
commit
4cb8e4a514
@ -67,7 +67,7 @@ type UserWithoutThirdIdp struct {
|
|||||||
CountryCode string `xorm:"varchar(6)" json:"countryCode"`
|
CountryCode string `xorm:"varchar(6)" json:"countryCode"`
|
||||||
Region string `xorm:"varchar(100)" json:"region"`
|
Region string `xorm:"varchar(100)" json:"region"`
|
||||||
Location string `xorm:"varchar(100)" json:"location"`
|
Location string `xorm:"varchar(100)" json:"location"`
|
||||||
Address Address `json:"address"`
|
Address []string `json:"address"`
|
||||||
Affiliation string `xorm:"varchar(100)" json:"affiliation"`
|
Affiliation string `xorm:"varchar(100)" json:"affiliation"`
|
||||||
Title string `xorm:"varchar(100)" json:"title"`
|
Title string `xorm:"varchar(100)" json:"title"`
|
||||||
IdCardType string `xorm:"varchar(100)" json:"idCardType"`
|
IdCardType string `xorm:"varchar(100)" json:"idCardType"`
|
||||||
@ -148,15 +148,6 @@ type ClaimsWithoutThirdIdp struct {
|
|||||||
jwt.RegisteredClaims
|
jwt.RegisteredClaims
|
||||||
}
|
}
|
||||||
|
|
||||||
type Address struct {
|
|
||||||
Formatted string `json:"formatted"`
|
|
||||||
StreetAddress string `json:"street_address"`
|
|
||||||
Locality string `json:"locality"`
|
|
||||||
Region string `json:"region"`
|
|
||||||
PostalCode string `json:"postal_code"`
|
|
||||||
Country string `json:"country"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func getShortUser(user *User) *UserShort {
|
func getShortUser(user *User) *UserShort {
|
||||||
res := &UserShort{
|
res := &UserShort{
|
||||||
Owner: user.Owner,
|
Owner: user.Owner,
|
||||||
@ -171,13 +162,6 @@ func getShortUser(user *User) *UserShort {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStreetAddress(user *User) string {
|
|
||||||
if len(user.Address) > 0 {
|
|
||||||
return user.Address[0]
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func getUserWithoutThirdIdp(user *User) *UserWithoutThirdIdp {
|
func getUserWithoutThirdIdp(user *User) *UserWithoutThirdIdp {
|
||||||
res := &UserWithoutThirdIdp{
|
res := &UserWithoutThirdIdp{
|
||||||
Owner: user.Owner,
|
Owner: user.Owner,
|
||||||
@ -203,14 +187,7 @@ func getUserWithoutThirdIdp(user *User) *UserWithoutThirdIdp {
|
|||||||
CountryCode: user.CountryCode,
|
CountryCode: user.CountryCode,
|
||||||
Region: user.Region,
|
Region: user.Region,
|
||||||
Location: user.Location,
|
Location: user.Location,
|
||||||
Address: Address{
|
Address: user.Address,
|
||||||
Formatted: "",
|
|
||||||
StreetAddress: getStreetAddress(user),
|
|
||||||
Locality: "",
|
|
||||||
Region: "",
|
|
||||||
PostalCode: "",
|
|
||||||
Country: "",
|
|
||||||
},
|
|
||||||
Affiliation: user.Affiliation,
|
Affiliation: user.Affiliation,
|
||||||
Title: user.Title,
|
Title: user.Title,
|
||||||
IdCardType: user.IdCardType,
|
IdCardType: user.IdCardType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user