Dynamic Page redirects back to the previous page after "next build"
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
I have a Dashboard application that requires the user to choose a Discord Bot. When they do, the bot should redirect the user to the Dashboard page. However, when the redirection takes place, the app immediately redirects the users back to the bot selection page. In the "npm run dev", I can see the loading page occur, which is on the client side, and then once the server-side should be rendered, the redirection takes place. I am using NextAuth for the Authentication and App Router.
This is the code for the redirection (It's a client component, thus router from next/navigation"
In the output displayed by the "next build" command, the respective is marked as dynamic. The build is successfully created, and other pages work, except the main dashboard.
This is the code for the redirection (It's a client component, thus router from next/navigation"
function checkSession(e) {
e.preventDefault();
if (session) {
update({
selectedBot: `${props.value}`,
});
router.push(`/bots/${props.value}/dashboard`);
} else {
signIn("discord");
}
}In the output displayed by the "next build" command, the respective is marked as dynamic. The build is successfully created, and other pages work, except the main dashboard.
1 Reply
Polar bearOP
If anyone needs more information, kindly ping me.