mrbusy
BABetter Auth
•Created by mrbusy on 4/30/2025 in #bug-reports
Data Types MSSQL
Hi all. Not sure if this is a bug or just a lack of knowledge on my part.
I have a next.js project using a mssql db and have generated/ migrated schema as per docs for all of the plugins. I've been setting up forgot password and update password but hitting an error with data types. For forgot password, the error occurs when the user has clicked on the link in the email (verifying the token??), and with update password, the error looks to be a call for accountId when it's writing the new password to the db.
Error: The data types text and nvarchar are incompatible in the equal to operator.
The schema has a number of fields as 'text' such as the tokens, accountId's etc but mssql no longer supports text as a data type so the db errors out on api calls that use these fields. I've manually updated the columns in my db to be varchar or nvarchar which has resolved the issue.
I updated better-auth from 1.2.3 to 1.2.6 which also meant the twofactor verification failed as the verification table is also set up with text.
I presume though that this is actually a bug for kyseley with a knock on impact here???2 replies
BABetter Auth
•Created by mrbusy on 3/28/2025 in #help
Admin to add users to their organisation
Hi all. I'm building out a Saas project in next.js where I will have clients set up as organisations and each client will have multiple users. I've implemented admin and organisation plugins, have created some organisations and created some users which is all good. The lead user (as an admin) can create other users but how do these new users get assigned in to the organisation? I have basic RBAC established so that only an organisations users can see data/ other users in that organisation.
5 replies