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 { betterAuth } from 'better-auth';
|
||||||
|
import { username } from 'better-auth/plugins';
|
||||||
import Database from 'better-sqlite3';
|
import Database from 'better-sqlite3';
|
||||||
|
|
||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
@ -7,4 +8,5 @@ export const auth = betterAuth({
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
autoSignIn: true,
|
autoSignIn: true,
|
||||||
},
|
},
|
||||||
|
plugins: [username()],
|
||||||
});
|
});
|
||||||
|
@ -37,6 +37,7 @@ export const actions = {
|
|||||||
name,
|
name,
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
|
username: name,
|
||||||
},
|
},
|
||||||
asResponse: true,
|
asResponse: true,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user