Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware Returning Null Session #12226

Open
joshuaepstein opened this issue Nov 12, 2024 · 0 comments
Open

Middleware Returning Null Session #12226

joshuaepstein opened this issue Nov 12, 2024 · 0 comments
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@joshuaepstein
Copy link

joshuaepstein commented Nov 12, 2024

Environment

  System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M3
    Memory: 80.00 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
    pnpm: 9.12.3 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 130.0.6723.117
    Safari: 18.2
  npmPackages:
    @auth/prisma-adapter: ^2.7.3 => 2.7.3 
    next: 15.0.2 => 15.0.2 
    next-auth: 5.0.0-beta.25 => 5.0.0-beta.25 
    react: 19.0.0-rc-02c0e824-20241028 => 19.0.0-rc-02c0e824-20241028 

Reproduction URL

https://github.com/joshuaepstein/logicate/tree/middleware-authentication

Describe the issue

When logging in, the browser stores the cookies and shows that it is logged in via the nav bar. The middleware however, doesn't respond the same and returns the session as null. I've tried adjusting my Next Auth Config but couldn't figure it out or find any similar issues

(Hosted on vercel and works in development environment)

I have also tried without prisma adapter and it did not resolve the issue.

How to reproduce

You can see the website here: https://logicate.uk

And login with email: [email protected] - And password: "password"
Once logged in it should take you to the home page and if you try to access the dashboard or canvases page it will return you back to the login page.

Expected behavior

Should return the correct session from the JWT getToken function.

@joshuaepstein joshuaepstein added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant