views:

259

answers:

1

Solution is called Portal which holds Areas/CMS/Login folder inside it. Login controller in CMS/Controllers is almost the same as AccountController in Portal solution. I customized Login and it works all fine except one thing: When I use [Authorize] filter and If user is not logged in than he is redirected to http://localhost:1177/Account/LogOn?ReturnUrl=%2fCMS%2fArticle and I would like that redirection takes user to here:
http://localhost:1177/CMS/Login

Any idea how to solve this?

Thanks in advance

+3  A: 

Your web.config will probably contain a portion that looks like this:

<authentication mode="Forms">
    <forms loginUrl="~/Account/LogOn" timeout="2880"/>
</authentication>

It is the loginUrl that defines where the AuthorizeAttribute redirects you to when the user is not authorized yet. The return url that is passed into the action is what you can use to redirect the user back to once he is authorized.

Thomas
yes, that's it. Thanks!!!
ile