fix: complete managed admin persistence

This commit is contained in:
kuekhaoyang
2026-07-21 20:50:34 +08:00
parent 387da736e1
commit a1a3821538
3 changed files with 11 additions and 20 deletions
+4 -13
View File
@@ -178,7 +178,10 @@ async function readManagedAccounts(): Promise<StoredAccountRecord[]> {
async function saveManagedAccounts(accounts: StoredAccountRecord[]): Promise<void> {
const redis = getRedisClient();
if (!redis) {
throw new Error('Managed auth storage unavailable');
throw new ManagedAuthStorageError(
'write',
new Error('Managed auth storage unavailable')
);
}
try {
@@ -375,18 +378,6 @@ async function authenticateManagedLogin(username: string, password: string): Pro
password,
getEffectiveAdminPassword()
);
if (usesBootstrapAdminCredential) {
return {
accountId: 'managed-admin-env',
profileId: 'managed-admin-env',
username: 'admin',
name: '超级管理员',
role: 'super_admin',
customPermissions: [],
mode: 'managed',
iat: Date.now(),
};
}
const accounts = await ensureManagedAccountsBootstrapped();
let account = accounts.find((item) => item.username === normalizedUsername);
+6 -6
View File
@@ -1,12 +1,12 @@
{
"name": "kvideo",
"version": "4.9.13",
"version": "4.9.14",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "kvideo",
"version": "4.9.13",
"version": "4.9.14",
"dependencies": {
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
@@ -3300,6 +3300,9 @@
"cpu": [
"arm64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -3333,7 +3336,7 @@
"arm64"
],
"libc": [
"glibc"
"musl"
],
"license": "MIT",
"optional": true,
@@ -3351,9 +3354,6 @@
"cpu": [
"arm64"
],
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "kvideo",
"version": "4.9.13",
"version": "4.9.14",
"private": true,
"scripts": {
"dev": "node scripts/next-with-lan-access.mjs dev",