mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Revert "fix: openid address format (#1157)"
This reverts commit a447d64bf217d260eb28d7112c167549467cc9c2.
This commit is contained in:
parent
07c1e3b836
commit
49022ef565
@ -16,7 +16,6 @@ package object
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/casdoor/casdoor/util"
|
"github.com/casdoor/casdoor/util"
|
||||||
@ -25,17 +24,12 @@ import (
|
|||||||
|
|
||||||
type Claims struct {
|
type Claims struct {
|
||||||
*User
|
*User
|
||||||
Address Address `json:"address"`
|
Nonce string `json:"nonce,omitempty"`
|
||||||
Nonce string `json:"nonce,omitempty"`
|
Tag string `json:"tag,omitempty"`
|
||||||
Tag string `json:"tag,omitempty"`
|
Scope string `json:"scope,omitempty"`
|
||||||
Scope string `json:"scope,omitempty"`
|
|
||||||
jwt.RegisteredClaims
|
jwt.RegisteredClaims
|
||||||
}
|
}
|
||||||
|
|
||||||
type Address struct {
|
|
||||||
Formatted string `json:"formatted"`
|
|
||||||
}
|
|
||||||
|
|
||||||
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"`
|
||||||
@ -78,9 +72,8 @@ func generateJwtToken(application *Application, user *User, nonce string, scope
|
|||||||
jti := fmt.Sprintf("%s/%s", application.Owner, name)
|
jti := fmt.Sprintf("%s/%s", application.Owner, name)
|
||||||
|
|
||||||
claims := Claims{
|
claims := Claims{
|
||||||
User: user,
|
User: user,
|
||||||
Address: Address{Formatted: strings.Join(user.Address, ",")},
|
Nonce: nonce,
|
||||||
Nonce: nonce,
|
|
||||||
// FIXME: A workaround for custom claim by reusing `tag` in user info
|
// FIXME: A workaround for custom claim by reusing `tag` in user info
|
||||||
Tag: user.Tag,
|
Tag: user.Tag,
|
||||||
Scope: scope,
|
Scope: scope,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user