feat: now dingtalk OAuth returns all error messages to frontend (#1405)

This commit is contained in:
Yaodong Yu
2022-12-17 21:10:20 +08:00
committed by GitHub
parent c0d9969013
commit 1ee2ff1d30

View File

@ -256,6 +256,8 @@ func (idp *DingTalkIdProvider) isUserInOrg(unionId string) (bool, error) {
} }
if data.ErrCode == 60121 { if data.ErrCode == 60121 {
return false, fmt.Errorf("the user is not found in the organization where clientId and clientSecret belong") return false, fmt.Errorf("the user is not found in the organization where clientId and clientSecret belong")
} else if data.ErrCode != 0 {
return false, fmt.Errorf(data.ErrMessage)
} }
return true, nil return true, nil
} }