diff --git a/package.json b/package.json index 30bba72..b66dcf2 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "test": "bun test" }, "dependencies": { - "argon2": "^0.40.1", "jose": "^5.3.0", "log": "^6.3.1", "result": "git+git@git.pband.ch:typescript/result.git", @@ -16,7 +15,6 @@ }, "devDependencies": { "@happy-dom/global-registrator": "^14.10.2", - "@types/argon2": "^0.15.0", "@types/bun": "^1.1.2", "@types/zxcvbn": "^4.4.4" }, diff --git a/src/pwd.ts b/src/pwd.ts index 3566cc2..1804fc3 100644 --- a/src/pwd.ts +++ b/src/pwd.ts @@ -1,13 +1,7 @@ -import argon from 'argon2' - -export function hash(pwd: string): Promise { - return argon.hash(pwd) +export function hash(pwd: string) : Promise { + return Bun.password.hash(pwd) } -export async function verify(pwd: string, hash: string): Promise { - try { - return await argon.verify(hash, pwd) - } catch (_) {} - - return false +export async function verify(pwd: string, hash: string) : Promise { + return Bun.password.verify(pwd, hash).catch(() => false) }