diff --git a/core/maingate.go b/core/maingate.go index 2066cd8..19c7f01 100644 --- a/core/maingate.go +++ b/core/maingate.go @@ -787,13 +787,18 @@ func (mg *Maingate) getProviderInfo(platform string, uid string) (string, string if provider == "" || providerid == "" { return "", "", errors.New("getProviderInfo - firebase info not found: " + provider + " / " + providerid) } + case "": + //guest auth + providerid = uid + if providerid == "" { + return "", "", errors.New("getProviderInfo - guest provider id not found: " + provider + " / " + providerid) + } default: provider = platform providerid = uid - } - - if provider == "" || providerid == "" { - return "", "", errors.New("getProviderInfo - provider info not found: " + provider + " / " + providerid) + if provider == "" || providerid == "" { + return "", "", errors.New("getProviderInfo - provider info not found: " + provider + " / " + providerid) + } } return provider, providerid, nil diff --git a/core/service.go b/core/service.go index 85098ee..453a8c9 100644 --- a/core/service.go +++ b/core/service.go @@ -420,6 +420,17 @@ func (sh *serviceDescription) link(w http.ResponseWriter, r *http.Request) { return } + if guestlink { + //기존 게스트 링크 삭제 + guestLinkId, err := primitive.ObjectIDFromHex(oldId) + if err == nil { + _, err = sh.mongoClient.Delete(CollectionLink, bson.M{ + "platform": oldType, + "_id": guestLinkId, + }) + } + } + logger.Println("link success :", r.URL.Query()) }