SweetAlert Variables

I want to be able to include a SweetAlert variable in both the title and the text of a SweetAlert.

I have the following code:

swal({
        title: "Log In",
        text: "Log In to your account.",
        icon: logInImage,
        content: "input",
        button: {
          text: "Log In",
          closeModal: false,
        },
        closeOnClickOutside: false,
        closeOnEsc: false
})
.then(unm => {
        if (!unm) throw null;
        swal({
          title: `Welcome, ${unm}!`
          text: `Your username is ${unm}.`
          buttons: false,
          icon: logInImage,
          closeOnClickOutside: false,
          closeOnEsc: false,
        })
});

But it does not work. I want the end result to be something like the following:

  1. Page opens and SweetAlert asks for the username.
  2. SweetAlert displays the second alert telling the user in both the title and the text what their username is

(If you don’t know what SweetAlert is, go to text.)
Version of SweetAlert: text