With nextJS is it a good/bad idea to
With nextJS is it a good/bad idea to move all of my api queries to convex actions?
11 Replies
Can you say more about the api queries
are they just to various external services
Yeah
I was thinking use convex actions to streamline all the logic
Because it can technically act as a DAL right?
Yep
And yeah there's not typically a good reason to have additional backends when you have Convex, tends to complicate things in my experience
What about security considerations? @erquhart
I’m tempted to implement Diffie-Hellman for session verification of sorts
cool cool lemme google "diffie hellman" quick and then i will give you my expert opinion lol
Honestly it's down to specific things you're doing and the sensitivity of the data
A lot of folks use a straight shared secret for server to server stuff, but if you need to or want to make it more secure, doesn't hurt
But if you're hitting services you don't own, they typically have a blessed method of secure interaction anyway
@erquhart Does better-auth convex adapter support the better-auth admin plugin?
I am thinking yes as of version 0.7.9?
Yep, it works in 0.7.x
@erquhart Got a question for ya, been trying to sort out checking authentication state properly with nextjs, it seems that sometimes user is undefined until i refresh the page, any ideas?
This would generally happen if your token is missing or expired
@erquhart sorry for repeated questions, how can I manually create a user instead of just being from a signup flow
with convex/better-aut
I think the admin plugin is the way to do that: https://www.better-auth.com/docs/plugins/admin#create-user