better user equality check

This commit is contained in:
Daniel Lugo 2020-02-27 18:54:05 -04:00
parent 065ca90550
commit 832957171c

View file

@ -250,10 +250,11 @@ const getUser = () => {
* Returns a promise containing the public key of the newly created user. * Returns a promise containing the public key of the newly created user.
* @param {string} alias * @param {string} alias
* @param {string} pass * @param {string} pass
* @param {UserGUNNode=} _user * @param {UserGUNNode=} __user
* @returns {Promise<string>} * @returns {Promise<string>}
*/ */
const authenticate = async (alias, pass, _user = user) => { const authenticate = async (alias, pass, __user) => {
const _user = __user || user
const isFreshGun = _user !== user const isFreshGun = _user !== user
if (isFreshGun) { if (isFreshGun) {
const ack = await new Promise(res => { const ack = await new Promise(res => {