t.getElementById('password').value;

        var connection;
        refreshToken(username, password)
            .then(function () {
                var options = {
                    accessTokenFactory: function () { return tokens[username]; }
                };
                connection = new signalR.HubConnectionBuilder()
                    .withUrl("/chatHub", options)
                    .build();

                connection.on('ReceiveMessage', msg => {
                    addLine(msg