Trying to use hapi-auth-cookie with a custom cookie name, validationFunc, and random password on each app restart seems to lead to "Bad cookie value" response anytime the app restarts. I thought clearInvalid would automatically clear the cookie, but it doesn't appear to.
Dirty sample below that shows basically what I'm doing without all the login/logout/etc... for clarity.
server.pack.register(Cookie, function (err){
server.auth.strategy('auth', 'cookie', {
password: config.password||uuid(),
cookie: 'myapp',
redirectTo: false,
validateFunc: validate,
isSecure: config.isSecure||false,
clearInvalid: true
});
server.route([
{
method: 'GET',
path: 'api/v1/test/auth',
handler: function(req, reply){
reply('Ok :)');
},
auth: 'auth'
}
]);
});
Any pointers on where I'm going wrong?
Trying to use hapi-auth-cookie with a custom cookie name, validationFunc, and random password on each app restart seems to lead to "Bad cookie value" response anytime the app restarts. I thought clearInvalid would automatically clear the cookie, but it doesn't appear to.
Dirty sample below that shows basically what I'm doing without all the login/logout/etc... for clarity.
Any pointers on where I'm going wrong?