title: Setting location.href in Ember.js
body: <p>I am developing an Ember.js application whose initial page resides at:</p>
  
  <p><code>https://localhost:8443/</code></p>
  
  <p>I want to perform a redirect from JavaScript to the following location if the user is authenticated:</p>
  
  <p><code>https://localhost:8443/admin</code></p>
  
  <p>To do this, I write code as follows:</p>
  
  <pre><code>App.ApplicationRoute = Ember.Route.extend({
    model: function () {
      var that = this,
          session = this.get('session'),
          sessionService = this.get('services').session();
  
      return sessionService.getStatus().then(function (sessionStatus) {
        session.setProperties(sessionStatus);
        if (/^\/[signup]|[forgotPassword]/.test(that.router.get('url'))) return;
        if (!session.get('authenticated'))
          that.transitionTo('signin');
        else
          window.location.href = window.location.origin + '/admin';
      });
    }
  });
  </code></pre>
  
  <p>However, when I do perform this, the page browses to:</p>
  
  <p><code>https://localhost/admin</code></p>
  
  <p>I also tried <code>location.assign()</code> with the same result. </p>
  
  <p>Why does setting <code>location.href</code> or <code>location.assign()</code> remove the port-number from the URL? Is this something that the Ember.js Router would be doing?</p>
  
  <p>Any other way I can accomplish this?</p>