mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🕸️ 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:
parent
b6fe7e5570
commit
3e0f95458f
10 changed files with 108 additions and 51 deletions
|
|
@ -29,7 +29,7 @@ const getUserPluginAuthValue = async (userId, authField) => {
|
|||
throw new Error(`No plugin auth ${authField} found for user ${userId}`);
|
||||
}
|
||||
|
||||
const decryptedValue = decrypt(pluginAuth.value);
|
||||
const decryptedValue = await decrypt(pluginAuth.value);
|
||||
return decryptedValue;
|
||||
} catch (err) {
|
||||
logger.error('[getUserPluginAuthValue]', err);
|
||||
|
|
@ -64,7 +64,7 @@ const getUserPluginAuthValue = async (userId, authField) => {
|
|||
|
||||
const updateUserPluginAuth = async (userId, authField, pluginKey, value) => {
|
||||
try {
|
||||
const encryptedValue = encrypt(value);
|
||||
const encryptedValue = await encrypt(value);
|
||||
const pluginAuth = await PluginAuth.findOne({ userId, authField }).lean();
|
||||
if (pluginAuth) {
|
||||
const pluginAuth = await PluginAuth.updateOne(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue