lonelyplanet
Explore posts from serversPPrisma
•Created by lonelyplanet on 4/14/2025 in #help-and-questions
Generate command not working
Solved, it did not like my output folder
8 replies
PPrisma
•Created by lonelyplanet on 4/14/2025 in #help-and-questions
Generate command not working
8 replies
BABetter Auth
•Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
yes
19 replies
BABetter Auth
•Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
Not bun.
19 replies
BABetter Auth
•Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
@bekacru what is the proper way to initalize a sqlite betterauth project and generate using the CLI and pnpm?
19 replies
BABetter Auth
•Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
And issue with similar issues is still open since december 2024, Surely by now this issue would of been documented or fixed:
https://github.com/better-auth/better-auth/issues/892
19 replies
BABetter Auth
•Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
Is there a different way to start with sqlite than following the guide, if not can the docs be looked at
19 replies
BABetter Auth
•Created by lonelyplanet on 3/28/2025 in #help
Betterauth CLI Fails on sqlite
Auth.ts
Installed
better-auth
,better-sqlite3
and @types/better-sqlite3
19 replies
BABetter Auth
•Created by lukas on 3/24/2025 in #help
Dealing with session expiration in a React app
Care to share your code?
13 replies
BABetter Auth
•Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
Your welcome again couldnt stress it enough https://orm.drizzle.team/docs/transactions, I promise you can save your self from failed half migrations
26 replies
BABetter Auth
•Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
In that case use SQL or Drizzle and write a script to do it for you
26 replies
BABetter Auth
•Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
Unless you have plaintext password then you can. I think the confussion can when you said seeding as this usally referrs to mockdata. You sound like you need to migrate user data
26 replies
BABetter Auth
•Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
You cant since signUpEmail takes the plaintext password which since you have hashed passwords you can do it.
26 replies
BABetter Auth
•Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
Are you using signUpEmail to migrate? you shouldn't instead use SQL directly or ORM and use db transactions
26 replies
BABetter Auth
•Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
2. If the fields should not be updated by the user use input:false as in documentation and you dont have to add your extra fields to the adtionalfields column you could instead use hooks https://www.better-auth.com/docs/concepts/database#database-hooks to fill in those extra fields on signup like adminNotes you could leave it out and add a hook before hook that adds the adminNotes field to be like "User Signed up",
If you need to update the adminNotes field use your ORM directly.
3. I dont recommend adding oldId as means more complexity use the single userId filed and migrate your current ids to strings if they are Ints and use the advanded option to either let the db generate Ids or add a custom id generate function
26 replies
BABetter Auth
•Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
1. If your getting errors on the authclient read up about inferring addtional fields (Read the whole typescript page, is useful) if your have numbered ID's Interger than convert to string before migrating.
26 replies
BABetter Auth
•Created by lukas on 3/24/2025 in #help
Dealing with session expiration in a React app
13 replies
BABetter Auth
•Created by lukas on 3/24/2025 in #help
Dealing with session expiration in a React app
See this hook from better-auth-tanstack it has when it expires it refetches ensure the session is constantly refreshes by betterauth
13 replies
BABetter Auth
•Created by lukas on 3/24/2025 in #help
Dealing with session expiration in a React app
13 replies
BABetter Auth
•Created by lukas on 3/24/2025 in #help
Dealing with session expiration in a React app
create a custom useSession hook that has a timeout that set to expiry time of session make sure you cleanup the timeout every render. In your hook you could have a sideeffect like onExpire and make it a funciton call the onExpire in the timeout
13 replies