From 49022ef565104a0815f54059e073cd1973c4ab50 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sun, 25 Sep 2022 09:54:29 +0800 Subject: [PATCH] Revert "fix: openid address format (#1157)" This reverts commit a447d64bf217d260eb28d7112c167549467cc9c2. --- object/token_jwt.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/object/token_jwt.go b/object/token_jwt.go index f5347717..07a13003 100644 --- a/object/token_jwt.go +++ b/object/token_jwt.go @@ -16,7 +16,6 @@ package object import ( "fmt" - "strings" "time" "github.com/casdoor/casdoor/util" @@ -25,17 +24,12 @@ import ( type Claims struct { *User - Address Address `json:"address"` - Nonce string `json:"nonce,omitempty"` - Tag string `json:"tag,omitempty"` - Scope string `json:"scope,omitempty"` + Nonce string `json:"nonce,omitempty"` + Tag string `json:"tag,omitempty"` + Scope string `json:"scope,omitempty"` jwt.RegisteredClaims } -type Address struct { - Formatted string `json:"formatted"` -} - type UserShort struct { Owner string `xorm:"varchar(100) notnull pk" json:"owner"` Name string `xorm:"varchar(100) notnull pk" json:"name"` @@ -78,9 +72,8 @@ func generateJwtToken(application *Application, user *User, nonce string, scope jti := fmt.Sprintf("%s/%s", application.Owner, name) claims := Claims{ - User: user, - Address: Address{Formatted: strings.Join(user.Address, ",")}, - Nonce: nonce, + User: user, + Nonce: nonce, // FIXME: A workaround for custom claim by reusing `tag` in user info Tag: user.Tag, Scope: scope,