gpt4 book ai didi

razor - Razor Preview 和 Razor Beta 之间表单例份验证的区别?

转载 作者:行者123 更新时间:2023-12-04 22:08:23 26 4
gpt4 key购买 nike

我正在尝试使用 Razor(来自预览版)将 MVC 项目升级到 Beta,现在我遇到了 Razor 没有进入它用来访问的登录 View 的奇怪现象(当有人要求执行需要授权的操作时)。

我的网络配置有

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

但是,每当命中具有 Authorize 属性的操作时,浏览器都会重定向到“帐户/登录”——注意登录*登录*而不是登录*登录*。有人知道如何在 MVC 3 Beta 中解决这个问题吗?

最佳答案

这是 Beta 版中的一个已知错误:Release Notes: Chapter Known Issues

There’s a known issue that causes Forms Authentication to always redirect unauthenticated users to /Account/Login, ignoring the forms authentication setting used in Web.config. The workaround is to add the following app setting.

<add key="autoFormsAuthentication" value="false" />

关于razor - Razor Preview 和 Razor Beta 之间表单例份验证的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3953462/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com