Profiles page is donegit add -A!
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ConvexError } from 'convex/values';
|
||||
import { Password } from '@convex-dev/auth/providers/Password';
|
||||
import { validatePassword } from './auth';
|
||||
import type { DataModel } from './_generated/dataModel';
|
||||
|
||||
export default Password<DataModel>({
|
||||
@@ -10,12 +11,7 @@ export default Password<DataModel>({
|
||||
};
|
||||
},
|
||||
validatePasswordRequirements: (password: string) => {
|
||||
if (
|
||||
password.length < 8 ||
|
||||
!/\d/.test(password) ||
|
||||
!/[a-z]/.test(password) ||
|
||||
!/[A-Z]/.test(password)
|
||||
) {
|
||||
if (!validatePassword(password)) {
|
||||
throw new ConvexError('Invalid password.');
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user