Fixing some issues detected by testing.
This commit is contained in:
parent
06d8d19aaa
commit
70242f3be7
|
@ -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 {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { v4 } from "uuid"
|
||||||
|
|
||||||
|
export function newid() {
|
||||||
|
return v4().replace(/-/g, "")
|
||||||
|
}
|
|
@ -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, "")
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue