Do not crash if we have a new user without a username yet

This commit is contained in:
Johannes Zellner
2026-02-09 20:34:05 +01:00
parent 3803f36aa5
commit a786e6c8f5
+1
View File
@@ -41,6 +41,7 @@ async function setProfileConfig(profileConfig, options, auditSource) {
for (const user of allUsers) {
if (user.twoFactorAuthenticationEnabled) continue;
if (options.persistUserIdSessions === user.id) continue; // do not logout the API caller
if (!user.username) continue; // if a user has no username set yet
await tokens.delByUserIdAndType(user.id, oidcClients.ID_WEBADMIN);
await oidcServer.revokeByUsername(user.username);