-
Scenario - Orchard Core CMS v1.0.0 - Nothing should be available to the an unauthenticated user. I've tried using HomeRoute, attempting to leverage the Account controller's Login method. The Account controller lives in OrchardCore.Users.
I've tried addControllers() in startup.cs' ConfigureServices method in an attempt to leverage endpoints, which results in MVC throwing that it has multiple matches for "default" (which would be expected as far as I can tell). So I created a "landing module" and tried:
I think this is the better approach, because my landing page could redirect from the controller to login, and upon login, it sends the user back the default homepage. Any advice is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
The landing page is a better approach. If you disable the View All Content permission for the Anonymous role, you will automatically get redirected to the login page if you are not authenticated. If you are using your own controllers/razor pages, simply apply permissions to the controllers to achieve the same behaviour |
Beta Was this translation helpful? Give feedback.
-
Disable home route feature and provide |
Beta Was this translation helpful? Give feedback.
-
For anyone who runs into this - being new to Orchard Core - my solution was I forgot to add a reference to the module I wanted as default in the host application. I was able to make my module be the default by mapping in startup.cs like this:
|
Beta Was this translation helpful? Give feedback.
Disable home route feature and provide
/
routing for your controller or page