I would like to remove the UserId
query-string from the ConfirmEmail
action in the AccountController
, as I do not want UserId
's to be sent in email messages.
Once I do this, I will still need to obtain the UserId
in order to call the method UserManager.ConfirmEmailAsync
. In order to do this, I plan to require authentication for the ConfirmEmail
action. This way I can call User.Identity.GetUserId()
to obtain the UserId
parameter needed to confirm the email address.
Upon logging in, if the user's email address is not confirmed, they will be redirected to the ConfirmEmail
page. Additionally, I would like to implement a check on every page load to see if the user's email is confirmed and if it isn't I would like them to be redirected to the ConfirmEmail
page.
My questions are as follows:
- How would I go about implementing this check on every page?
- Would there be a large performance penalty on checking if a user's email is confirmed on every page? If so, would it be better to store the confirmed value in a session variable and check that instead?
- If I do end up using a session variable can it easily be removed or changed by a user?
- Am I on the completely wrong track? Is there a better way of doing this?
Thanks for all your help!