Nodejs | HAPI framework- How to Get client request object within server.register

Viewed 22

Using HAPI framework, to handle SAML, from two VIP in my nodejs application, and I want to send 'callbackUrl' option, according to VIP used, i.e.:

if I use in my browser "www.myapp.com" => inside "server.registry" callbackURL: 'www.myapp.com' else with "exp.myapp.com" => callbackURL: "exp.myapp.com"

server.register({
    register: require('./libs/hapi-passport-saml'),
    options: {
        callbackUrl: //which VIP used 'www.myapp.com' or 'exp.myapp.com' ??
        ...
    }
}, function (err) {
    if (err) {
        logger.error(err);
        throw err;
    }
});

Thank you

0 Answers
Related