From 832957171cc6c1f2072fe649158aa7ae87e5155e Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 27 Feb 2020 18:54:05 -0400 Subject: [PATCH] better user equality check --- services/gunDB/Mediator/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/gunDB/Mediator/index.js b/services/gunDB/Mediator/index.js index 4d692246..29c30cff 100644 --- a/services/gunDB/Mediator/index.js +++ b/services/gunDB/Mediator/index.js @@ -250,10 +250,11 @@ const getUser = () => { * Returns a promise containing the public key of the newly created user. * @param {string} alias * @param {string} pass - * @param {UserGUNNode=} _user + * @param {UserGUNNode=} __user * @returns {Promise} */ -const authenticate = async (alias, pass, _user = user) => { +const authenticate = async (alias, pass, __user) => { + const _user = __user || user const isFreshGun = _user !== user if (isFreshGun) { const ack = await new Promise(res => {