middleware/mw.auth.token.js
function init(ctx) {
        var server = ctx.server;

        if (!privateKey) {
            throw new Error('Please set config.security.token.privateKey');
        }

        server.ext('onPreAuth', validateToken);

        return new Q(ctx);
    }
function init(ctx) {
        var server = ctx.server;

        if (!privateKey) {
            throw new Error('Please set config.security.token.privateKey');
        }

        server.ext('onPreAuth', validateToken);

        return new Q(ctx);
    }
function init ( ctx ) { var server = ctx . server ; if ( ! privateKey ) { throw new Error ( 'Please set config.security.token.privateKey' ) ; } server . ext ( 'onPreAuth' , validateToken ) ; return new Q ( ctx ) ; }
Register the hapi auth strategy
@param ctx
Register the hapi auth strategy