How to fetch session from auth server
Hello!
I am loving better-auth so far, however, I am having one problem:
I have an auth server with the following auth files:
How would I fetch a session from the server in a different application? When I attempt to do so, the endpoint goes through and everything works, however, the response is blank, versus when I hit the endpoint directly I get a response with the session. Is there something wrong with my server or application configuration? If so, how do I fix it? Thanks!
2 Replies
better auth works with cookies by default. If your app isn't sending a proper cookie, it wont be able to read the token and return a session. if you're not using cookies, you can check the bearer plugin for authorization header auth.
So how would I send the proper cookie after it redirects using the callback URL? Is that possible yet? I’m not sure if I mentioned but my application is also using better-auth.