I'm adding email verification to an MVC4 website that uses the WebSecurity membership stuff.
If a user registers, we send them an email with a link. If they try to login prior to confirming their registration, WebSecurity.Login() fails. Okay, that's reasonable.
What I need the site to do is recognize that it is awaiting them to complete confirmation and notify them. So I have code like:
if (ModelState.IsValid && !WebSecurity.IsConfirmed(model.UserName))
{
// Inform the user
return RedirectToAction("ConfEmailSent");
}
The controller is marked with the [Authorize] attribute and the action itself is marked with [AllowAnonymous].
The Redirect fails, but if I manually change the URL in the browser, it works just fine.
Is this an MVC4 bug or am I missing something here?
if I manually change the URL in the browser, it works just fine.
Could you elaborate more? – WinThe Redirect fails
? What does the user see? – Cloud SME