vue-auth
vue-auth copied to clipboard
Add Additional check for a function for the Cookie Expiration
With this PR, you can now update the cookie expiration dynamically based on a function call. Addresses https://github.com/websanova/vue-auth/issues/669
Cookie can be setup as such:
cookie: {
Path: '/',
Secure: true,
Expires: expiresAt(), // accepts a custom function name and parameters if needed
SameSite: 'Strict'
},
Hmm, not quite sure what you're trying to achieve now, if you want to pass a function I think it should be like this.
if (typeof val === 'string') {
return val;
}
else if (typeof val === 'function') {
return val();
}
Otherwise it will just return a function. But not sure if you're having something else in mind?