mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
fix: infoflow's parameter error (#480)
* fix: missing state parameter Signed-off-by: Steve0x2a <stevesough@gmail.com> * fix: infoflow's parameter error Signed-off-by: Steve0x2a <stevesough@gmail.com> * fix: use userid instead of imid Signed-off-by: Steve0x2a <stevesough@gmail.com>
This commit is contained in:
parent
5640d258bb
commit
63161d6135
@ -130,8 +130,10 @@ type InfoflowInternalUserResp struct {
|
|||||||
type InfoflowInternalUserInfo struct {
|
type InfoflowInternalUserInfo struct {
|
||||||
Errcode int `json:"errcode"`
|
Errcode int `json:"errcode"`
|
||||||
Errmsg string `json:"errmsg"`
|
Errmsg string `json:"errmsg"`
|
||||||
Imid string `json:"imid"`
|
UserId string `json:"userid"`
|
||||||
|
Imid int `json:"imid"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
Avatar string `json:"headimg"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,9 +178,10 @@ func (idp *InfoflowInternalIdProvider) GetUserInfo(token *oauth2.Token) (*UserIn
|
|||||||
return nil, fmt.Errorf("userInfoResp.errcode = %d, userInfoResp.errmsg = %s", infoResp.Errcode, infoResp.Errmsg)
|
return nil, fmt.Errorf("userInfoResp.errcode = %d, userInfoResp.errmsg = %s", infoResp.Errcode, infoResp.Errmsg)
|
||||||
}
|
}
|
||||||
userInfo := UserInfo{
|
userInfo := UserInfo{
|
||||||
Id: infoResp.Imid,
|
Id: infoResp.UserId,
|
||||||
Username: infoResp.Name,
|
Username: infoResp.UserId,
|
||||||
DisplayName: infoResp.Name,
|
DisplayName: infoResp.Name,
|
||||||
|
AvatarUrl: infoResp.Avatar,
|
||||||
Email: infoResp.Email,
|
Email: infoResp.Email,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ func GetIdProvider(typ string, subType string, clientId string, clientSecret str
|
|||||||
return NewBaiduIdProvider(clientId, clientSecret, redirectUrl)
|
return NewBaiduIdProvider(clientId, clientSecret, redirectUrl)
|
||||||
} else if typ == "Infoflow" {
|
} else if typ == "Infoflow" {
|
||||||
if subType == "Internal" {
|
if subType == "Internal" {
|
||||||
return NewInfoflowInternalIdProvider(clientId, clientId, appId, redirectUrl)
|
return NewInfoflowInternalIdProvider(clientId, clientSecret, appId, redirectUrl)
|
||||||
} else if subType == "Third-party" {
|
} else if subType == "Third-party" {
|
||||||
return NewInfoflowIdProvider(clientId, clientSecret, appId, redirectUrl)
|
return NewInfoflowIdProvider(clientId, clientSecret, appId, redirectUrl)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user