전자 메일로 보낸 토큰에 의해 사용자 계정을 확인하기위한 새로운 작업을 만들었습니다. 그것은 다음과 같습니다 :이 작업에ASP.NET MVC 4 잘못된 리디렉션
public ActionResult ConfirmToken(string id)
{
bool isConfirmed;
isConfirmed = WebSecurity.ConfirmAccount(id);
if (isConfirmed)
{
return RedirectToAction("Index", "Home", new { Message = ManageMessageId.ConfirmSuccess });
}
else
{
return RedirectToAction("Index", "Home", new { Message = ManageMessageId.ConfirmFail });
}
}
그리고 예를 들어 링크는 다음과 같습니다 로컬 호스트 : 57904/계정/ConfirmToken/ubiJScfyP9zM1WUPCdb54Q2/
문제는, 내가 이제까지 홈에서 말했다 색인 작업을 리디렉션 만나지 제어 장치. 나는 끊임없이 매개 변수의 반환 URL로 이전 링크로 계정/로그인으로 리디렉션됩니다. 내가 코드에 추가 한 내용은 중요하지 않습니다. 나는 전체 ConfirmToken 작업을 제거 할 때
- , 나는 오류를 얻을
- 몸에 아무것도 액션이, 심지어 그때/로그인
내가 계정을 리디렉션하고있다 이 ASP.NET MVC 4 개념에 익숙하지 않은 것 같습니다. Visual Studio 2012를 사용하고 있습니다.
편집 : 코드 자체에 문제가 있는지 알 수 없습니다. 그것은 기본적으로 몇 시간 전에 만든 빈 프로젝트이고 사용자 등록 프로세스를 약간 수정했습니다. 처음에는 계정/로그인으로의 리다이렉션이 포함되었으므로 코드가 새로 고침되지 않는 것처럼 느껴졌지만 변경하고 싶었습니다.
EDIT2 : 여기 당신은 인증 문제가 당신에게 로그인보기를 리디렉션하지 않습니다 확인 전에 로그인 시도에 직면하고 나의 색인/홈 액션
public ActionResult Index(ManageMessageId? message)
{
ViewBag.StatusMessage =
message == ManageMessageId.RegisterSuccess ? "An e-mail has been sent to the e-mail address you provided. It contains instructions how to confirm your account and finish the registration process. If you cannot see the e-mail in your inbox, please check spam folder."
: message == ManageMessageId.ConfirmSuccess ? "Your account has been successfully confirmed and you can now login."
: message == ManageMessageId.ConfirmFail ? "An error occured while activating your account. Please mail our support for assistance."
: "";
return View();
}
색인/홈에 [권한 부여] 속성이 있습니까? 네트워크 요청을 확인하면 홈/색인으로 이동하려고합니까? 아니면 계정/로그인으로 직접 이동합니까? – dougajmcdonald
아니요, 속성이 없습니다 –
양식 인증을 사용하고 있습니까? – meda