[이민권] link, unlink 이슈 수정
This commit is contained in:
@ -329,6 +329,13 @@ func (sh *serviceDescription) link(w http.ResponseWriter, r *http.Request) {
|
||||
// fmt.Println(oldAuth.Uid)
|
||||
// fmt.Println("=================")
|
||||
|
||||
oldType, oldId, err := sh.getProviderInfo(oldType, oldId)
|
||||
if err != nil {
|
||||
logger.Error("getProviderInfo failed :", err)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
//if oldAuth.Token != oldToken || oldAuth.Uid != oldId || oldAuth.Platform != oldType {
|
||||
if oldAuth.Uid != oldId || oldAuth.Platform != oldType {
|
||||
logger.Println("link failed. session key is not correct :", *oldAuth, queryvals)
|
||||
@ -452,6 +459,13 @@ func (sh *serviceDescription) unlink(w http.ResponseWriter, r *http.Request) {
|
||||
// fmt.Println(authInfo.Uid)
|
||||
// fmt.Println("=================")
|
||||
|
||||
sType, sId, err := sh.getProviderInfo(sType, sId)
|
||||
if err != nil {
|
||||
logger.Error("getProviderInfo failed :", err)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
if authInfo.Uid != sId || authInfo.Platform != sType {
|
||||
logger.Println("unlink failed. session key is not correct :", *authInfo, queryvals)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
|
||||
Reference in New Issue
Block a user