mirror of
https://github.com/twofas/2fas-server.git
synced 2025-01-07 06:55:49 +01:00
rm unused
This commit is contained in:
parent
8ee34d13eb
commit
df104398da
@ -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"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user