Fixing some issues detected by testing.

This commit is contained in:
mike12345567 2022-11-26 21:26:19 +00:00
parent 93cb1c52de
commit 6ac4669f0a
3 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { newid } from "../utils" import { newid } from "../utils/hashing"
import { DEFAULT_TENANT_ID, Config } from "../constants" import { DEFAULT_TENANT_ID, Config } from "../constants"
import env from "../environment" import env from "../environment"
import { import {

View File

@ -0,0 +1,5 @@
import { v4 } from "uuid"
export function newid() {
return v4().replace(/-/g, "")
}

View File

@ -1,6 +1,6 @@
import env from "../environment" import env from "../environment"
export * from "../newid"
const bcrypt = env.JS_BCRYPT ? require("bcryptjs") : require("bcrypt") const bcrypt = env.JS_BCRYPT ? require("bcryptjs") : require("bcrypt")
import { v4 } from "uuid"
const SALT_ROUNDS = env.SALT_ROUNDS || 10 const SALT_ROUNDS = env.SALT_ROUNDS || 10
@ -12,7 +12,3 @@ export async function hash(data: string) {
export async function compare(data: string, encrypted: string) { export async function compare(data: string, encrypted: string) {
return bcrypt.compare(data, encrypted) return bcrypt.compare(data, encrypted)
} }
export function newid() {
return v4().replace(/-/g, "")
}