Client UUID added to JWT
This commit is contained in:
parent
dfd6260a7a
commit
dc010df448
6 changed files with 65 additions and 38 deletions
|
|
@ -13,7 +13,6 @@ export class Sync {
|
|||
// The latest sync node value is used to retrieve the changes
|
||||
// from the backend.
|
||||
const state = await nodeStore.getAppState('latest_sync_node')
|
||||
const clientUUID = await nodeStore.getAppState('client_uuid')
|
||||
const oldMax = (state?.value ? state.value : 0)
|
||||
let currMax = oldMax
|
||||
|
||||
|
|
@ -22,7 +21,7 @@ export class Sync {
|
|||
let batch = 0
|
||||
do {
|
||||
batch++
|
||||
res = await API.query('POST', `/sync/from_server/${oldMax}/${offset}`, { ClientUUID: clientUUID.value })
|
||||
res = await API.query('POST', `/sync/from_server/${oldMax}/${offset}`)
|
||||
if (res.Nodes.length > 0)
|
||||
console.log(`Node sync batch #${batch}`)
|
||||
offset += res.Nodes.length
|
||||
|
|
@ -96,10 +95,8 @@ export class Sync {
|
|||
break
|
||||
console.debug(`Sending ${nodesToSend.length} node(s) to server`)
|
||||
|
||||
const clientUUID = await nodeStore.getAppState('client_uuid')
|
||||
const request = {
|
||||
NodeData: JSON.stringify(nodesToSend),
|
||||
ClientUUID: clientUUID.value,
|
||||
}
|
||||
const res = await API.query('POST', '/sync/to_server', request)
|
||||
if (!res.OK) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue