How to Redirect to an URL from javascript

I am using javascript for authorizing credentials for my web portal. After the credentials are validated i need to redirect the control to another page and also pass the header details along with the redirection. I am using .Net MVC framework. I had provided the sample jquery code I had used, someone please help me achieve this.

$(document).ready(function (){

    $("#loginform").submit(function (event){
        event.preventDefault();

        let $form = $(this),
            user = $form.find("input[name='user'").val(),
            pwd = $form.find("input[name='pwd'").val();

        loginPost(user, pwd);

    })

    function loginPost(user, pwd) {
        $.ajax({
            url:"/api/auth/login",
            type:"POST",
            async:false,
            data: {user, pwd},
            success: function (data) {
                let urlLogin;
                if(data["role"] === "ROLE_USER") {
                    urlLogin = "/api/user"
                } else {
                    urlLogin = "/api/admin"
                }
                $.ajax({
                    url:urlLogin,
                    type:"GET",
                    async: false,
                    headers: {
                        "Authorization": "Bearer "+data["token"]
                    }
                })
            }
        })
    }