diff --git a/services/gunDB/Mediator/index.js b/services/gunDB/Mediator/index.js index ea0e373f..3a063988 100644 --- a/services/gunDB/Mediator/index.js +++ b/services/gunDB/Mediator/index.js @@ -198,9 +198,6 @@ const authenticate = async (alias, pass) => { if (typeof ack.err === 'string') { throw new Error(ack.err) } else if (typeof ack.sea === 'object') { - API.Jobs.onAcceptedRequests(user, mySEA) - API.Jobs.onOrders(user, gun, mySEA) - mySec = await mySEA.secret(user._.sea.epub, user._.sea) _currentAlias = user.is ? user.is.alias : '' @@ -208,6 +205,9 @@ const authenticate = async (alias, pass) => { await new Promise(res => setTimeout(res, 5000)) + API.Jobs.onAcceptedRequests(user, mySEA) + API.Jobs.onOrders(user, gun, mySEA) + return ack.sea.pub } else { throw new Error('Unknown error.')