[nodejs] passport js authentication from different schemas

2015-01-07 Thread Sachin Rajput
Hi, I am using passport js bearer strategy for session authentication. passport.use(new BearerStrategy( function(token, done) { Student.findOne({ token: token }, function (err, student) { if (err) { return done(err); } if (!student) { return done(null, false); } return don

[nodejs] os-service - run node.js programs as operating system servces - i.e. Windows Services or Linux Daemons

2015-01-07 Thread Stephen Vickers
Hi, I've recently released the os-service module to npm: https://www.npmjs.com/package/os-service This module provides a consistent interface for installing node.js programs as operating system services. On Windows this module uses the WIN32 API to add and remove the service, and to connect t

[nodejs] Re: Form validation (C# ASP MVC)

2015-01-07 Thread Peter Morris
I am hoping for middleware suggestions. I like express-validator, but now I just need a suggestion on how to default input() values to what was posted (and null if it is a GET request). -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderat

[nodejs] Re: Form validation (C# ASP MVC)

2015-01-07 Thread Peter Morris
I created the following plugin exports = module.exports = function (req, res, next) { var body = req.body; if (typeof body === 'undefined') { return next(new Error('form-values must be used after body-parser')); } var bodyKeys = Object.keys(req.body); res.locals.fv

[nodejs] Re: Get HTTPS response outside of the current function

2015-01-07 Thread zladuric
I assume you're trying to make a synchronous call from a node.js script, then when it finishes, do other things as well. If your other scripts are also node.js, you would probably add a `callback` parameter to your _call method, and call it when done. Example: function _call(cb) {

Re: [nodejs] NPM and sudo

2015-01-07 Thread Zlatko Đurić
2015-01-07 1:35 GMT+01:00 Aria Stewart : > > > On Jan 6, 2015, at 3:57 AM, zladuric wrote: > > > > Technically, sudo npm isn't running as root. It's running as that user, > but with root privileges. Do files get written as the user to, say, > /usr/local. > > I'm not sure there's a meaningful diff

Re: [nodejs] passport js authentication from different schemas

2015-01-07 Thread Adrien Risser
Hi, You might need concept of a "User" instead of just Student / Teacher. passport.use(new BearerStrategy( function(token, done) { User.findOne({ token: token }, function (err, user) { if (err) { return done(err); } if (!user) { return done(null, false); } return done(null

Re: [nodejs] Re: Payment Gateway / Card Processing

2015-01-07 Thread Carlos Carcamo
Thanks Angel, mango looks great, do you know any other that operates on latin america? I would like to compare options 2015-01-06 18:25 GMT-06:00 Angel Java Lopez : > The new kid on the block > > https://getmango.com/en/ > > with a REST API > > Angel "Java" Lopez > @ajlopez > > > On Tue, Jan 6, 2

Re: [nodejs] Re: Accessing the client certificate in TLS/HTTPS

2015-01-07 Thread Mike Post
That gives you the certificate data, but it's only a representation of the certificate -- not the full certificate data. For example, the certificate's serial number, version, and SKI are not available from getPeerCertificate as of node 0.10.35. On Sunday, February 20, 2011 2:24:30 PM UTC-6, R

[nodejs] Re: good tutorial about for example a reservation system

2015-01-07 Thread Simon Ho
We don't have a tutorial for a a reservation or commenting system yet (feel free to ask request an example in the LoopBack Google Group ), but we do have examples on relations in LoopBack (which is Express underneath the hood). https://github.

[nodejs] Change storage locations

2015-01-07 Thread Andre Basel
I have just installed the Node Version Manager and now realise that I need to change the storage location. How do I do this? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node

[nodejs] Changing default data directory

2015-01-07 Thread Andre Basel
I installed Node Version Manager using curl https://raw.githubusercontent.com/creationix/nvm/v0.22.0/install.sh | bash (as per https://github.com/creationix/nvm) I now realise that I should have done a customised install to change the data location. How do I now go about changing where the nod