ShowLoginPage – I originally had a condition on the page that indicated which action to use depending on the current user’s authenticated state. But, the point of this is to not do that kind of logic on the page, so I moved it to the ShowLoginPage action. If the user is authenticated, it redirects to the Logout action. Otherwise, it shows the login page.
Logout – Easy enough… Logout, then redirect to the home page. This shows that the controllers are aware of each other. I’m not sure if that’s correct, but I don’t know of another way to do it, so there you go.
Login – Users will login by email address. They’ll have a username too, but that’ll be for display purposes. The membership provider supports login by username, so I have to find the username by searching on the email address. The Find returns a collection of users. You can retrieve from the collection by username, but we don’t have a username, so we have to enumerate to the first one. That was inconvenient. users would’ve been swell.
I haven’t handled a failed login yet. Essentially, I want it to load the same view but pass it an error message. That’ll be new.