Setting cookies with custom plugin auth
Hi, I'm having a few issues with setting this up the way that I want it to but I may be approaching it from the wrong way. I am using another application that I want users to be able to single click sign on into but it is not an Idp or oauth provider. Instead it providers a token in the URL that I can decrypt.
The current imagined workflow is as follows:
The above code does not add the cookies into the browser and does not set them either. I have added the
Any help would be greatly appreciated - losing my mind over this.
The current imagined workflow is as follows:
- User clicks button
- Gets sent to
/api/auth/test/sso - Create a new plugin that creates a new auth endpoint to decrypt it, create a new user if doesnt exists.
- Redirect the user to the authenticated
page./dashboard
The above code does not add the cookies into the browser and does not set them either. I have added the
nextCookies plugin as well as the methods ctx.setCookie from https://www.better-auth.com/docs/concepts/hooks#cookies. Any help would be greatly appreciated - losing my mind over this.