mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 01:01:20 +10:00
switch back to json
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
import bcrypt from "bcryptjs";
|
||||
import * as argon2 from "argon2";
|
||||
import { type } from "arktype";
|
||||
|
||||
// const bcryptRounds = 10;
|
||||
// export async function createHashBcrypt(password: string) {
|
||||
// return await bcrypt.hash(password, bcryptRounds);
|
||||
// }
|
||||
export const simpleAuth = type({
|
||||
version: "string.semver",
|
||||
password: "string",
|
||||
});
|
||||
|
||||
export type SimpleAuthType = typeof simpleAuth.infer;
|
||||
|
||||
export async function checkHashBcrypt(password: string, hash: string) {
|
||||
return await bcrypt.compare(password, hash);
|
||||
|
||||
Reference in New Issue
Block a user