Greetings, thank you for your quick response. Here is the code I wrote. It’s an POST http endpoint which is called from my desktop app upon login. I am currently trying to query more information about the user after I have logged him in, but I am unable to do so as I receive the following error after the contacts query:
{
“details” : {
“applicationError” : {
“description” : “Forbidden” ,
“code” : “FORBIDDEN” ,
“data” : {}
}
}
}
export function post_authenticate(request) {
return request.body.text()
.then( (body) => {
const {email, password} = JSON.parse(body);
return authentication.login(email, password)
.then( (sessionToken) => {
let response = {
"headers":{
"Content-Type":"application/json"
},
"body":{
}
};
return contacts
.queryContacts()
.find()
.then((results) =>{
console.log(results);
return ok(response);
})
})
.catch((error) => {
let response = {
"headers":{
"Content-Type":"application/json"
},
"body": {
}
};
response.body = error;
return forbidden(response);
})
})
}
Any help would be highly appreciated.