🕸️ refactor: Migrate from crypto to Web Crypto API (#3357)

* move crypto to async webcrypto

update encrypt/decrypt

forgot await

* chore: import order - openidStrategy.js

* chore: import order - Session.js

* chore: import order - AuthController.js

* Update AuthService.js

---------

Co-authored-by: Danny Avila <danacordially@gmail.com>
This commit is contained in:
matt burnett 2024-08-04 23:59:45 -04:00 committed by GitHub
parent b6fe7e5570
commit 3e0f95458f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 108 additions and 51 deletions

View file

@ -50,7 +50,7 @@ const getUserKey = async ({ userId, name }) => {
}),
);
}
return decrypt(keyValue.value);
return await decrypt(keyValue.value);
};
/**
@ -109,7 +109,7 @@ const getUserKeyExpiry = async ({ userId, name }) => {
* after encrypting the provided value. It sets the provided expiry date for the key.
*/
const updateUserKey = async ({ userId, name, value, expiresAt = null }) => {
const encryptedValue = encrypt(value);
const encryptedValue = await encrypt(value);
let updateObject = {
userId,
name,