fix: Force unique usernames
Force unique usernames by using the username plugin for BetterAuth
This commit is contained in:
parent
360fbc644d
commit
7e9e1da56e
@ -1,4 +1,5 @@
|
||||
import { betterAuth } from 'better-auth';
|
||||
import { username } from 'better-auth/plugins';
|
||||
import Database from 'better-sqlite3';
|
||||
|
||||
export const auth = betterAuth({
|
||||
@ -7,4 +8,5 @@ export const auth = betterAuth({
|
||||
enabled: true,
|
||||
autoSignIn: true,
|
||||
},
|
||||
plugins: [username()],
|
||||
});
|
||||
|
@ -37,6 +37,7 @@ export const actions = {
|
||||
name,
|
||||
email,
|
||||
password,
|
||||
username: name,
|
||||
},
|
||||
asResponse: true,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user