From df104398da1ed4d0daac23d9738afbd2dd07466a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Dry=C5=9B?= Date: Mon, 6 May 2024 20:49:27 +0200 Subject: [PATCH] rm unused --- internal/pass/sync/sync.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/internal/pass/sync/sync.go b/internal/pass/sync/sync.go index 04b1671..49bd4ad 100644 --- a/internal/pass/sync/sync.go +++ b/internal/pass/sync/sync.go @@ -2,7 +2,6 @@ package sync import ( "context" - "encoding/json" "errors" "fmt" "net/http" @@ -128,30 +127,6 @@ func (s *Syncing) sendTokenAndCloseConn(fcmToken string, conn *websocket.Conn) e return conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) } -func (s *Syncing) sendMobileToken(fcmToken string, resp http.ResponseWriter) error { - extProxyToken, err := s.signSvc.SignAndEncode(sign.Message{ - ConnectionID: fcmToken, - ExpiresAt: time.Now().Add(syncTokenValidityDuration), - ConnectionType: sign.ConnectionTypeMobileSyncConfirm, - }) - if err != nil { - return fmt.Errorf("failed to generate ext proxy token: %v", err) - } - - bb, err := json.Marshal(struct { - MobileSyncConfirmToken string `json:"mobile_sync_confirm_token"` - }{ - MobileSyncConfirmToken: extProxyToken, - }) - if err != nil { - return fmt.Errorf("failed to marshal the response: %v", err) - } - if _, err := resp.Write(bb); err != nil { - return fmt.Errorf("failed to write the response: %v", err) - } - return nil -} - type ConfirmSyncResponse struct { ProxyToken string `json:"proxy_token"` }