mirror of
https://github.com/tale/headplane.git
synced 2026-07-27 16:18:57 +00:00
chore: handle empty (already migrated) user oidc file
This commit is contained in:
@@ -246,6 +246,16 @@ async function migrateUserDatabase(path: string, db: LibSQLDatabase) {
|
||||
|
||||
try {
|
||||
const data = await readFile(realPath, 'utf8');
|
||||
if (data.trim().length === 0) {
|
||||
log.info('config', 'Old user database file is empty, nothing to migrate');
|
||||
log.info(
|
||||
'config',
|
||||
'You SHOULD remove oidc.user_storage_file from your config!',
|
||||
);
|
||||
await rm(realPath, { force: true });
|
||||
return;
|
||||
}
|
||||
|
||||
const users = JSON.parse(data.trim()) as {
|
||||
u?: string;
|
||||
c?: number;
|
||||
|
||||
Reference in New Issue
Block a user