'use strict'
const User = require('../models/user.js');
const ApiController = {
getMe(req, res) {
User.findById(req.user, function (err, user) {
if (!user) {
return res.status(404).send({message: 'User not found'});
}
res.send(user);
});
}
};
module.exports = ApiController;
However, when I go to 'localhost/me' to look what the server has returned, I always get the following message: {"message":"Please make sure your request has an Authorization header"}
Hi! I'm creating an Aurelia project that contains facebook login. My code is similar to https://github.com/paulvanbladel/aurelia-auth-sample .
My files are: authUtils.js: https://gist.github.com/LeoNero/68a8188f4dbbf24dea8143255ed07a4c
routes/api.js
controllers/api.js
However, when I go to 'localhost/me' to look what the server has returned, I always get the following message:
{"message":"Please make sure your request has an Authorization header"}
How can I fix it?