Class UmbLoginStatusController
Surface controller that handles member logout from the Login Status snippet.
Namespace: Umbraco.Cms.Web.Website.Controllers
Assembly: Umbraco.Web.Website.dll
Syntax
[UmbracoMemberAuthorize]
public class UmbLoginStatusController : SurfaceController, IDiscoverable
Constructors
View SourceUmbLoginStatusController(IUmbracoContextAccessor, IUmbracoDatabaseFactory, ServiceContext, AppCaches, IProfilingLogger, IPublishedUrlProvider, IMemberSignInManager)
Initializes a new instance of the UmbLoginStatusController class.
Declaration
public UmbLoginStatusController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, AppCaches appCaches, IProfilingLogger profilingLogger, IPublishedUrlProvider publishedUrlProvider, IMemberSignInManager signInManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IUmbracoContextAccessor | umbracoContextAccessor | |
| IUmbracoDatabaseFactory | databaseFactory | |
| ServiceContext | services | |
| AppCaches | appCaches | |
| IProfilingLogger | profilingLogger | |
| IPublishedUrlProvider | publishedUrlProvider | |
| IMemberSignInManager | signInManager |
Methods
View SourceHandleLogout(PostRedirectModel)
Handles the logout form post, signing the current member out if they are authenticated.
Declaration
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
[ValidateUmbracoFormRouteString]
public Task<IActionResult> HandleLogout(PostRedirectModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| PostRedirectModel | model | The posted model, optionally containing a redirect URL. |
Returns
| Type | Description |
|---|---|
| Task<IActionResult> | A redirect to the supplied local URL when provided; otherwise a redirect to the current Umbraco page. |