修复postgrep的用户导出

This commit is contained in:
mtvpls
2026-02-11 00:51:06 +08:00
parent 22b9242e39
commit 84c5d7a9f0

View File

@@ -170,6 +170,14 @@ async function getUserPasswordV2(username: string): Promise<string | null> {
// 检查存储类型
const storageType = process.env.NEXT_PUBLIC_STORAGE_TYPE || 'localstorage';
// PostgreSQL 存储:使用 getUserPasswordHash 方法
if (storageType === 'postgres') {
if (typeof storage.getUserPasswordHash === 'function') {
return await storage.getUserPasswordHash(username);
}
return null;
}
// D1 存储:使用 getUserPasswordHash 方法
if (storageType === 'd1') {
if (typeof storage.getUserPasswordHash === 'function') {