p2p instant question sending fixes

This commit is contained in:
mrfry
2023-04-26 15:02:50 +02:00
parent 977c118da8
commit f047701106
9 changed files with 75 additions and 56 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { PeerInfo } from '../types/basicTypes'
import { paths } from './files'
import { parseCookies, post } from './networkUtils'
import { parseCookie, post } from './networkUtils'
import utils from './utils'
export function peerToString(peer: {
@@ -33,7 +33,7 @@ export function updatePeersFile(
}
export async function loginToPeer(peer: PeerInfo): Promise<string | Error> {
const { data, error, cookies } = await post<{
const { data, error, cookie } = await post<{
result: string
msg: string
}>({
@@ -48,6 +48,6 @@ export async function loginToPeer(peer: PeerInfo): Promise<string | Error> {
return data ? new Error(data.msg) : error
}
const parsedCookies = parseCookies(cookies)
const parsedCookies = parseCookie(cookie)
return parsedCookies.sessionID
}