ProgrammerGuide.Net | Step by Step Programmer Guide

Simplifying AccountController by Removing External Login Related Actions | ASP.NET MVC Tutorial

There are a number of methods on AccountController related to External Logins. If you examine AccountController carefully, you can go through and delete the code for the following actions:

  • Dissociate()
  • ExternalLogin()
  • ExternalLoginCallback()
  • LinkLogin()
  • LinkLoginCallback()
  • ExternalLoginConfirmation()
  • ExternalLoginFailure()
  • RemoveAccountList()

Additionally, there is a code #region for helpers. From here, we can delete the following items:

  • The member constant XsrfKey
  • The entire class ChallengeResult

At this point, we can also right-click in the code file and select Remove and Sort Usings to clear out unused namespaces

Delete External Login Related Views:
Along with the unnecessary Controller methods we just removed, we can also remove the unnecessary views related to external logins. If we open the Views => Account folder in Solution Explorer, we find we can delete the highlighted views below from our project:

Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?