Update db schema + add hasher func
This commit is contained in:
5
concord-server/src/helper/hashing.ts
Normal file
5
concord-server/src/helper/hashing.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as crypto from 'crypto';
|
||||
|
||||
export default function shaHash(data:string, salt:string) : string {
|
||||
return crypto.createHmac('sha256', salt).update(data).digest('hex');
|
||||
}
|
||||
@@ -18,4 +18,6 @@ export const createUserSchema = z.object({
|
||||
admin: z.boolean().default(false),
|
||||
})
|
||||
|
||||
export type QueryUserByIdInput = z.infer<typeof queryUserByIdSchema>
|
||||
export type QueryAllUsersByInstanceIdInput = z.infer<typeof queryAllUsersByInstanceId>
|
||||
export type CreateUserInput = z.infer<typeof createUserSchema>
|
||||
Reference in New Issue
Block a user