Manually create a session
Hi, for testing purposes I want to create a session in my own controller, and set the right cookies. Although, it seems like the sesison token has to be in a certain structure. Has anyone got a better idea on how I can implement this?
The cookie names do match, I am using NextJS so I would need a backend approach to create the sessions.
Solution:Jump to solution
hmm...you can fill it with those details -
```ts
import { createRandomStringGenerator } from "@better-auth/utils/random";
import { createHMAC } from "@better-auth/utils/hmac";...
GitHub
GitHub - better-auth/utils: A simple typescript API for common auth...
A simple typescript API for common auth related operations built on top of Web Crypto API. - better-auth/utils
3 Replies
š
š¦
Solution
hmm...you can fill it with those details -
this is what the better auth does internally .. for more utils please make sure to visit https://github.com/better-auth/utils
GitHub
GitHub - better-auth/utils: A simple typescript API for common auth...
A simple typescript API for common auth related operations built on top of Web Crypto API. - better-auth/utils
Ahhh thanks!! I wasn't aware of the signing š®