Dustin
BABetter Auth
•Created by Dustin on 4/25/2025 in #help
Extending the Organization plugin
I would like to add functionality to the organization plugin, is there a way to extend it? Or do I just add features to the original plugin?
My idea is to use groups to, well, group users, where a user can join multiple groups and an org can have multiple groups, with a simple management API. Creating groups, deleting groups, updating groups / group members. These should not be used for permissions but simply for organization of users
7 replies
BABetter Auth
•Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
Hi,
I am creating my own plugin that creates groups within organizations.
Part of my schema is this:
group_member: {
fields: {
groupId: {
type: "string",
required: true,
references: {
model: "group",
field: "id",
onDelete: "cascade",
},
},
memberId: {
// This is supposed to be a organization member id, not a user ID!!!
type: "string",
required: true,
references: {
model: "member",
field: "id",
onDelete: "cascade",
},
},
},
},
However, I cannot delete a group if it still has members.
I am getting:
# SERVER_ERROR: update or delete on table "group" violates foreign key constraint "group_member_groupId_fkey" on table "group_member"
I would assume that onDelete: "cascade" just deletes the the group_member row?27 replies
BABetter Auth
•Created by Dustin on 4/7/2025 in #help
How to run the client on a server route as admin
Hi,
I am using Nuxt and have the admin plugin installed. I want to List all users, which is possible If the user doing the query is of role "admin". But if not, the query fails, which is correct. But, how would I do this in a server environment? I need to check in a server route if a user exists, how do i do this?
If I dont pass headers, I get 401, If I do, I get 403.
3 replies
BABetter Auth
•Created by Dustin on 3/31/2025 in #help
MSSQL not working at all
Hi,
is anyone using BetterAuth with MSSQL via Kysely? Migrations run fine for me, I can see the tables getting created in the DB, there is only 1 other table in it. When trying to login, I get:
SERVER_ERROR: The data types text and nvarchar are incompatible in the equal to operator.
I can see multiple text columns in the BetterAuth tables.
Is anyone experiencing this?
I am using MSSQL 2019
4 replies