Browse Source

Merge branch 'slim' into cash

utxos
Evan Feenstra 4 years ago
parent
commit
63fcfd68f4
  1. 7
      dist/src/controllers/contacts.js
  2. 2
      dist/src/controllers/contacts.js.map
  3. 8
      src/controllers/contacts.ts

7
dist/src/controllers/contacts.js

@ -65,8 +65,11 @@ exports.generateToken = (req, res) => __awaiter(void 0, void 0, void 0, function
}
}
if (owner) {
const hash = crypto.createHash('sha256').update(req.body['token']).digest('base64');
console.log("req.body['token']", req.body['token']);
const token = req.body['token'];
if (!token) {
return res_1.failure(res, {});
}
const hash = crypto.createHash('sha256').update(token).digest('base64');
if (owner.authToken) {
if (owner.authToken !== hash) {
return res_1.failure(res, {});

2
dist/src/controllers/contacts.js.map

File diff suppressed because one or more lines are too long

8
src/controllers/contacts.ts

@ -62,9 +62,11 @@ export const generateToken = async (req, res) => {
}
if (owner) {
const hash = crypto.createHash('sha256').update(req.body['token']).digest('base64');
console.log("req.body['token']", req.body['token']);
const token = req.body['token']
if(!token) {
return failure(res, {})
}
const hash = crypto.createHash('sha256').update(token).digest('base64');
if (owner.authToken) {
if (owner.authToken!==hash) {

Loading…
Cancel
Save