I am trying to migrate from nextauth to better-auth. Problem is that we have a few custom nextauth
CredentialsProvider
CredentialsProvider
s that take arbitrary input and create a session by simply returning a user object. I am trying to re-implement this in better-auth, but it appears that there is no generic plugin that allows arbitrary input, so I am trying to create my own.
The documentation shows how to create a custom plugin in better-auth:
Problem is that this is just showing how to send back a hello world message, which is rather useless. How do I make it so that this plugin signs the user in? (i.e. creates cookies and assigns them to the user, similar to what happens when a built-in plugin is called: