I have a route configured to redirect to a default page /patients
, and otherwise it sends the user to /login
. Currently if I navigate to localhost:<port>
, I get the default page. The problem arises from wanting to click on the logo with href='/'. When I do this it does not call the resolve function. It renders nothing, essentially, and removes the page elements that are meant to live behind authentication.
Is this configured wrong? Can anyone tell me what is happening here? Please let me know if you need more info. Thanks.
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider.
when('/patients', {
templateUrl: '/templates/dashboard.html',
requireLogin: true,
resolve: {
auth: function (SessionService) {
SessionService.resolve()
}
}
}).
when('/', {
redirectTo: '/patients'
}).
otherwise({
redirectTo: '/login'
});