Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

login redirect changed after using microsoft.web.helpers

In an asp.net mvc3 website, I imported the microsoft.web.helpers, webmatrix.data, and webmatrix.webdata. After that, I have found that when I use the [Authorize] attribute on some ActionResults in Controllers, my redirect points to account\login and not account\logon which is what it had done before and is the default.

I'm not using WebMatrix but would like to use the microsoft.web.helpers functionality. I've searched in code for any reference to account\login but there isn't any I could find. My web config for authentication is shown below:

 <authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
like image 924
liquidanswer Avatar asked Apr 05 '11 05:04

liquidanswer


1 Answers

To override use:

<configuration>
  <appSettings>
    <add key="loginUrl" value="~/Account/Logon" />
  </appSettings>
</configuration>

From http://www.redmountainsw.com/wordpress/archives/webmatrix-redirects-unauthorized-pages-to-accountlogin

like image 109
Duncan Watts Avatar answered Sep 20 '22 21:09

Duncan Watts