Looking at that I think what you are seeing is the homepage being displayed with the BankDetails template, and not actually your bank-details page, which is protected.
This is the alt-template functionality, which you can disable if you wish in the umbracoSettings.config.
Disabling the alt templates feature should just stop you being able to use those, and shouldn't have an affect on the redirect part. At least not that I know of.
Is the redirect immediately after the login, or whilst logged in and attempting to visit the protected page?
I Can access protected page even when I’m logged out!!
Hi, I can still access a protected page even after I have logged out!
Set-up
I have a content page bank-detail.
I have set this page to be protected.
This page is protected; you cannot access this page unless you are logged in.
So if I type the following
url http://localhost:56973/bank-details/
I am re-directed to the login page, all good!!
But if I type the url with the page’s template’s name for the content page i.e. if I type the following url
http://localhost:56973/ BankDetails /
The bank-details page is then displayed!!
i.e Login
I then logged out and paste the url into the browser
http://localhost:56973/BankDetails
How do I protect the BankDetails.cshtml
Looking at that I think what you are seeing is the homepage being displayed with the BankDetails template, and not actually your bank-details page, which is protected.
This is the alt-template functionality, which you can disable if you wish in the umbracoSettings.config.
Hi Anthony, do you mean in the web config file?
Nope, it's at the bottom of the umbracoSettings.config in the config folder.
Hi Anthony, yep that worked, but its causing me other issues..
When I login and click on the link for the Bank Details, I am re-directed to the home page.
I'm not entirely sure what's going on there Tom.
Disabling the alt templates feature should just stop you being able to use those, and shouldn't have an affect on the redirect part. At least not that I know of.
Is the redirect immediately after the login, or whilst logged in and attempting to visit the protected page?
Whilst I'm login, I have nav bar with a link to the Bank Details.
The Bank Details templates renders a partial view.
This partial view is the issue, it's not protected, how do I protect this view?
Sorry Tom, I'm a bit lost now as to what you are trying to do.
Why is the nav link going to the template by name, and not the page instead?
Do you mean, you don't want that link to appear in the Nav if the user doesn't have access to it?
Or am I barking up the wrong tree and it's something completely different?
Thanks Anthony, you are spot on!! I need to link to the page, not the template...
Thanks again :)
Not a problem Tom.
Glad I could help.
is working on a reply...