there! I want to configure the first screen as a login page. However, after logging in, we want to prevent the user from going to the login page after confirming the login with the cookie value. The configuration file is as below, and how can I solve it?
next.config.js
module.exports = {
async redirects() {
return [
{
source: "/",
destination: "/login",
permanent: false,
has: [
{
type: "cookie",
key: "authorized",
value: "access_token",
},
],
},
];
},
};