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

getServerSession is broken using local provider #811

Closed
FrankoFM opened this issue Jul 17, 2024 · 2 comments
Closed

getServerSession is broken using local provider #811

FrankoFM opened this issue Jul 17, 2024 · 2 comments
Labels
bug A bug that needs to be resolved

Comments

@FrankoFM
Copy link

FrankoFM commented Jul 17, 2024

Environment

0.8.0

Reproduction

More or less following the playground-local

Describe the bug

When using getServerSession it always results in a 500 Error with the message:

Tried to get server session without setting up an endpoint to handle authentication (see https://github.com/sidebase/nuxt-auth#quick-start)

Additional context

I currenly dont have the time to dive deeper into this, but thats what I found:
getServerSession is defined here
It will check for preparedAuthHandler, followed by a fetch, then checking again, without ever setting the value, so it has to result in said error.

Logs

No response

@FrankoFM FrankoFM added bug A bug that needs to be resolved pending An issue waiting for triage labels Jul 17, 2024
@FrankoFM
Copy link
Author

I also noticed that the /session endpoint is hardcoded here, but it should use the value defined in the nuxt config.

@FrankoFM FrankoFM changed the title getServerSession is broken getServerSession is broken using local provider Jul 17, 2024
@zoey-kaiser
Copy link
Member

getServerSession is not supported by the local or refresh providers at the moment, as the local and refresh providers were built to also support static deployments, which is why they placed a focus on client-side interactions.

There is currently an open issue (#854) and PR (#855) that aims to add getServerSession and getToken to the local and refresh providers. You can follow along with the process in these two places!

@zoey-kaiser zoey-kaiser removed the pending An issue waiting for triage label Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug that needs to be resolved
Projects
None yet
Development

No branches or pull requests

2 participants