mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 05:28:23 +00:00
removed async in crypto.subtle
This commit is contained in:
@@ -6,12 +6,15 @@ import crypto from "crypto";
|
|||||||
export const checkIsPasswordBreached = async (password: string) => {
|
export const checkIsPasswordBreached = async (password: string) => {
|
||||||
const dataBreachCheckAPIBaseURL = "https://api.pwnedpasswords.com/range/";
|
const dataBreachCheckAPIBaseURL = "https://api.pwnedpasswords.com/range/";
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
console.log("password:", password); // delete later!!!
|
||||||
|
|
||||||
const textEncoder = new TextEncoder();
|
const textEncoder = new TextEncoder();
|
||||||
|
|
||||||
const encodedPwd = textEncoder.encode(password);
|
const encodedPwd = textEncoder.encode(password);
|
||||||
console.log("encodedPwd:", encodedPwd); // delete later!!!
|
console.log("encodedPwd:", encodedPwd); // delete later!!!
|
||||||
|
|
||||||
const hashBuffer = await crypto.subtle.digest("SHA-1", encodedPwd);
|
const hashBuffer = crypto.subtle.digest("SHA-1", encodedPwd); // removed async
|
||||||
console.log("hashBuffer:", hashBuffer); // delete later!!!
|
console.log("hashBuffer:", hashBuffer); // delete later!!!
|
||||||
|
|
||||||
const hashedPwd = Array.from(new Uint8Array(hashBuffer))
|
const hashedPwd = Array.from(new Uint8Array(hashBuffer))
|
||||||
|
|||||||
Reference in New Issue
Block a user