Setting cookies in electron with better-auth
I have my app properly setup to successfully redirect to an external browser to login with twitch in my electron app. I was able to successfuly get the callback to redirect back to my app, however the cookie doesnt get set. I have tried to manually set the cookie myself, but cant figure out how to get the second half of the token that is set. Any help would be greatly appreciated thanks!
4 Replies
you may need to make a work around when it redirects back to the electron app to send the session token in a url instead and store it in the electron app. And on subsequent requests you can send it as a cookie or use bearer plugin to send just the token.
I was able to create a custom ‘after’ hook that used newSession to send the token back to the electron app, however this only provided the first half of the token before the dot. Is there a way to get the entire token? Thanks!
you can use the bearer plugin to send the token as it is
but as Authorization header
Will try that!