[이민권] link, unlink 이슈 수정

This commit is contained in:
2023-08-23 18:53:24 +09:00
parent 1db22730aa
commit 02c4f9e3d1

View File

@ -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)