Is there a way to redirect the user from checkout to the join page ONLY if there is no cookie user_token. Next.js allows to set only strings and undefined as value, but I need to validate that there is no cookie:
redirects: async () => [
{
source: '/checkout',
has: [
{
type: 'cookie',
key: 'user_token',
value: '',
},
],
permanent: true,
destination: '/join',
},
],
I tried to use regex for empty string, but it did not work:
redirects: async () => [
{
source: '/checkout',
has: [
{
type: 'cookie',
key: 'user_token',
value: '(^$)',
},
],
permanent: true,
destination: '/join',
},
],