Tailspin.Surveys.Web.Security.SignInManager.SignOutAsync C# (CSharp) Method

SignOutAsync() public method

Signs the currently signed in principal out of all authentication schemes and clears any access tokens from the token cache.
public SignOutAsync ( string redirectUrl = null ) : Task
redirectUrl string A Url to which the user should be redirected when sign out of AAD completes.
return Task
        public async Task<IActionResult> SignOutAsync(string redirectUrl = null)
        {
            var userObjectIdentifier = _httpContext.User.GetObjectIdentifierValue();
            var issuer = _httpContext.User.GetTenantIdValue();

            try
            {
                _logger.SignoutStarted(userObjectIdentifier, issuer);

                await _httpContext.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);

                await _httpContext.Authentication.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme,
                    new AuthenticationProperties { RedirectUri = redirectUrl });

                _logger.SignoutCompleted(userObjectIdentifier, issuer);
            }
            catch (Exception exp)
            {
                _logger.SignoutFailed(userObjectIdentifier, issuer, exp);
                return new HttpStatusCodeResult((int)HttpStatusCode.InternalServerError);
            }

            return new EmptyResult();
        }
    }