Monday, 10 April 2017

Send value in body from angular2 service

I have an Angular2 service

logIn (username, password): Observable<User[]> {
  return this.http.get(this.getUserUrl + username + '/' + password)
     .map(this.extractData)
     .catch(this.handleError);
}

which sends a request to

router.get('/authenticate/:username/:password', function(req, res, next) {
schema.User.find({ username: req.param("username"), password: req.param("password")}).exec(function (err, users) {
    if (err)
      return console.error(err);
      console.log("Load success: ", users);
      res.send(users);
    });
});

but i need a way to send the username, and especially the password in a way which doesn't expose it to the request itself



via Fripo

No comments:

Post a Comment