So I have ui-router in my application and everything has been working fine. I was asked to make the account area of the site forced HTTPS so I set up this rule:
I have a link on the main "view" that takes you to the login page and the link looks just like this:
<a class="link-primary" ui-sref="login" ng-switch-default>Sign in</a>
The state rule set up looks like this:
.state('login', {
url: '/account/signin',
params: {
returnState: null,
returnParams: null
},
templateUrl: '/assets/tpl/account/signin.tpl.html',
controller: 'LoginController',
controllerAs: 'controller',
resolve: {
pageTitle: ['PageHead', function (service) {
service.setTitle('Kudos Sports - Login');
}]
}
})
When I click the link I get an error message:
XMLHttpRequest cannot load https://kudos-topspindigital.azurewebsites.net/assets/tpl/account/signin.tpl.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://kudos-topspindigital.azurewebsites.net' is therefore not allowed access.
I can type the url (https://kudos-topspindigital.azurewebsites.net/account/signin) and this works without any issues. I can even do it by omitting the https protocol and it will redirect with no issues, so I can only assume there is something wrong with angularJS.
Can someone help me fix my issue?