The issue I am facing is as follows:
The project has a dashboard that can be viewed after authentication. The auth is working fine but probably the bug is somewhere there. When the correct details has been entered , you will be taken to the Dashboard page and that's ok. While the site has navigated to the Dashboard page, the address bar will still be pointing to http://localhost:3000/login instead of http://localhost:3000/dashboard
If I want to close the site with the close button on this instance, the site will not close - i guess this is because the address is pointing to the destination page - to close it , I need to navigate to other pages first.
Pages to look at for debugging:
- Login-form.tsx - calls the server function
authenticate- the form uses the serveractionmethod. - the
authenticatefunction is in theaction.tsfile - lines 83 - 152 - when the data is correct the
createSessionfunction is called from thesession.tsfile
// helper function for creating a new session
export async function createSession(userId: string) {
const expires = new Date(Date.now() + 60 * 60 * 1000);
const session = await encrypt({ userId, expires });
cookies().set("session", session, {
httpOnly: true,
secure: true,
expires: expires,
sameSite: "lax",
path: "/",
});
redirect("/dashboard");
}```
at this point , i expect the address bar to have the correct path
you can test using the following details
1. email: `user@nextmail.com`
2. password: `123456`
Links
1. Github repository: https://github.com/ChamuMutezva/personal-finance-dashboard
2. Live preview link: https://personal-finance-dashboard-two.vercel.app/