Я новичок в Hapijs, и у меня возникли проблемы с моей конфигурацией маршрута.Не удается установить режим try в hapijs route и haps-auth-cookie
Ошибка:
[1] "auth" must be a string
[2] "strageties" is not allowed
Маршрут
exports.register = (server, options, next) => {
server.route({
method: 'GET',
path: '/',
config: {
auth: {
mode: 'try',
strageties: ['session'] // or strategy: 'session'
},
handler: (request, reply) => {
return reply.view('partials/index');
}
}
});
return next();
};
exports.register.attributes = {
name: 'routes-home'
};
Stragety
server.auth.strategy(Providers.Session, 'cookie', {
password: config.server.SECRET,
redirectTo: '/login',
isSecure: false
});
Im используя счастливым-AUTH-печенье и колокольчик. У меня также есть больше стратегий, таких как github, twitter ... Если я настрою auth на просто сеанс, он работает. auth: 'session'