We have an email confirmation page for registration, which can be deleted using the "once" link to activate your account.
The nature of the site is such that we can allow this link to automatically register the user. This requirement is pending (at my request!).
The following situation is a bit confusing:
- The user follows the confirmation link in his letter
- This applies to the Confirm controller.
All that is good, the user is automatically registered using:
FormsAuth.SignIn(user.UserName,false);
The view is returned from the controller
The view uses the main page, which contains a partial view, which is a component of LogonUserControl.ascx . Inside the component there is the following code (it comes from the asp.net mvc project template):
if (Request.IsAuthenticated) { }
When the page is displayed, Request.IsAuthenticated returns false, despite the fact that the user signs it on the controller.
I wonder why this might be. Has the wizard been generated by the time the FormsAuth.SignIn method is called, or is it using the Request object for this verification, because it was not authenticated at the time the Request was received?
EDIT: By default, LogOn uses redirection by default rather than returning a view. This, of course, will solve the problem, however, I am interested in why the script above does not work.
source share