improve(api): cache salts
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { generateSalt } from '@openpanel/common/server';
|
||||
import { db, getCurrentSalt } from '@openpanel/db';
|
||||
import { getRedisCache } from '@openpanel/redis';
|
||||
|
||||
export async function salt() {
|
||||
const oldSalt = await getCurrentSalt().catch(() => null);
|
||||
@@ -18,5 +19,7 @@ export async function salt() {
|
||||
},
|
||||
});
|
||||
|
||||
await getRedisCache().del('op:salt');
|
||||
|
||||
return newSalt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user