Dan Romero
@dwr.eth
Use quick auth!
6 replies
2 recasts
54 reactions
onten.eth 🎩
@rezaisgoat.eth
Kind of related, but not that much. I have created a Farcaster Auth plugin for better-auth which I find to be more straightforward and framework agnostic than the nextauth v4 method used in the template for mini apps. I would appreciate it if you guys could take a look, mention possible issues with it and star it on GitHub so I could talk to the better-auth team and add it as an official plugin to their library when I get the feelings that it's more complete. cc @deodad @samuellhuber.eth @v @dwr.eth https://github.com/iamlotp/Farcaster-Auth-Plugin-Better-Auth-
2 replies
0 recast
2 reactions
onten.eth 🎩
@rezaisgoat.eth
P.s: I tried using auth.js (aka nextauth v5) but the library won't let you have database sessions for custom credentials and I didn't want to use jwt so I used better-auth.
0 reply
0 recast
0 reaction
Tony D’Addeo
@deodad
cool, a few quick pieces of feedback: - the nonce needs to be saved somewhere and "consumed" such that it can only be used exactly once, in a library I'd expect this to also be parameterized so that devs could bring their own persistence layer, something like `type NonceManager = { generate(): Promise<string>, consume(nonce: string): Promise<{ success: boolean }>`. The consume fn needs to return false unless it both recognizes the nonce and the nonces hasn't been consumed already, check out the quick-auth server for an example that achieves this using a cloudflare durable worker https://github.com/farcasterxyz/quick-auth/blob/main/hono-cloudflare-worker/src/nonce.ts
1 reply
0 recast
1 reaction