added tons of features
This commit is contained in:
24
lib/db/prisma/seed/user.ts
Normal file
24
lib/db/prisma/seed/user.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {User} from '@prisma/client'
|
||||
import * as argon2 from 'argon2'
|
||||
|
||||
import type {prismaClientType} from '@/lib/db/prisma/seed/main'
|
||||
import {hashPassword} from '@/lib/utils'
|
||||
|
||||
export const superUserSeed = async function (prisma: prismaClientType) {
|
||||
// const hashedPassword = await hashPassword('b00st!667')
|
||||
//
|
||||
// console.log(hashedPassword, await argon2.verify(hashedPassword, 'b00st!667'))
|
||||
|
||||
const user: User = await prisma.user.create({
|
||||
data: {
|
||||
locale: 'uk',
|
||||
active: true,
|
||||
name: 'Yevhen Odynets',
|
||||
username: 'sv-yeod',
|
||||
email: 'yevhen.odynets@ugmail.org',
|
||||
password: 'hashedPassword'
|
||||
}
|
||||
})
|
||||
|
||||
return user
|
||||
}
|
||||
Reference in New Issue
Block a user