

We can invoke this method and if it returns true, this is where we can place some markup to display the username, display a logout button. An extension method IsSignedIn is also available here. This will allow a signed in user to log out and also display the an anonymous user, we will show a login link.Īll the information you need to build this UI is available from the Razor view context.įirst, let us add the namespace in your layout (User.IsSignedIn()) else is a User property that is available inside every Razor view and we want to build a UI that will display the logged in user's name. Let us proceed with the Layout view because we want to build a UI that has some links. Logout is rather simple to implement as compared to login.
:max_bytes(150000):strip_icc()/006-how-to-sign-out-of-gmail-1172003-e25295c0e4574db0979b5fac1f5a474f.jpg)
In this chapter, we will discuss the login and logout feature.
