Skip to content

Commit e19d86b

Browse files
committed
Found the bug in the JSON parsing. Pushing clean version.
This should now properly return the data object.
1 parent 66f710d commit e19d86b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

v2.0/helpers/validation/validateuser.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const checktoken = async function(req, res, next) {
3636
if (postresponse.status === 200) {
3737
const responsetext = await postresponse.text();
3838
const result = await JSON.parse(responsetext);
39-
console.log(result);
4039
if (Object.keys(result).includes('error')) {
4140
const msg = 'The ORCID token passed to Neotoma is not valid:' +
4241
token;
@@ -48,13 +47,13 @@ const checktoken = async function(req, res, next) {
4847
});
4948
} else {
5049
const dbpush = await db.one(insertuserlogin,
51-
{'orcidid': result['user']['id'], 'ipaddr': ipaddr});
50+
{'orcidid': result['id'], 'ipaddr': ipaddr});
5251
const uuidres = await dbpush;
5352
res.status(200)
5453
.json({
5554
status: 'success',
5655
data: {
57-
user: result['user'],
56+
user: result,
5857
neotoken: uuidres,
5958
},
6059
message: 'Neotoma token expires in 1wk',

0 commit comments

Comments
 (0)