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

        return registerCookieJar(server)
            .then(function () {
                registerJwtCookie(server);
                server.ext('onPreAuth', getJwtFromCookie);

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

        return registerCookieJar(server)
            .then(function () {
                registerJwtCookie(server);
                server.ext('onPreAuth', getJwtFromCookie);

                return new Q(ctx);
            });
    }
function init ( ctx ) { var server = ctx . server ; return registerCookieJar ( server ) . then ( function ( ) { registerJwtCookie ( server ) ; server . ext ( 'onPreAuth' , getJwtFromCookie ) ; return new Q ( ctx ) ; } ) ; }
Register the cookie jar and move the token from the cookie to the request auth
@param ctx
Register the cookie jar and move the token from the cookie to the request auth