check auth

This commit is contained in:
Daniel Lugo 2020-01-13 22:05:53 -04:00
parent 4e24f81f8a
commit a72f6dd091

View file

@ -849,6 +849,10 @@ const sendHRWithInitialMsg = async (
* @returns {Promise<void>}
*/
const sendPayment = async (to, amount, memo, gun, user, SEA) => {
if (!user.is) {
throw new Error(ErrorCode.NOT_AUTH)
}
const recipientEpub = await Utils.pubToEpub(to)
const ourSecret = await SEA.secret(recipientEpub, user._.sea)