allow the client to request its preferred username even if webapp-wide auth is enabled since some VMs might not support auth

This commit is contained in:
Elijah R 2024-04-07 14:39:38 -04:00
parent 837a34d8cc
commit 70a2f9cc4e

View File

@ -429,7 +429,7 @@ async function openVM(vm: VM): Promise<void> {
// Connect to node
chatMessage('', `<b>${vm.id}</b><hr>`);
let username = Config.Auth.Enabled ? null : localStorage.getItem('username');
let username = Config.Auth.Enabled ? (auth!.account?.username ?? null) : localStorage.getItem('username');
let connected = await VM.connect(vm.id, username);
elements.adminInputVMID.value = vm.id;
w.VMName = vm.id;