Session token received but it doesn't work
Hello friends, I tried to authenticate by following a video with next.js. At first I couldn't even log in, but I made a mistake and I fixed it. My problem now is that when I log in to the site, the session token is created and I can see it from devtools. However, logically, the logged in user should not be able to come back, but I can come back to the login page. https://github.com/HikmetMelikk/authnmore You can review the codes here and we can discuss them. Thanks in advance.
GitHub
trying something from scratch. Contribute to HikmetMelikk/authnmore development by creating an account on GitHub.
Solution
Use the file middleware.ts (or .js) in the root of your project to define Middleware. For example, at the same level as pages or app, or inside src if applicable.
