ody: JSON.stringify(credentialsForServer)
            });

            if (!res.ok) {
                throw new Error(`HTTP error! status: ${res.status}`);
            }
        }

        async function login(authid) {
            let response = await fetch(`/login/begin?authid=${authid}`, {
                method: 'GET'
            });

            if (!response.ok) {
                throw new Error(`HTTP error! status: ${response.status}`);
            }

            let data = await response.json();
   