protected override async Task HandleSignOutAsync(SignOutContext signOutContext)
        {
            var ticket = await EnsurePlatformTicket();

            var PlatformOptions = BuildCookieOptions();

            if (Options.UserSessionStore != null && _sessionKey != null)
            {
                await Options.UserSessionStore.RemoveAsync(_sessionKey);
            }
            _IPlatformService.SignOut(_sessionKey);

            var context = new PlatformSigningOutContext(
                Context,
                Options,
                new AuthenticationProperties(signOutContext.Properties),
                PlatformOptions);

            await Options.Events.SigningOut(context);

            Options.CookieManager.DeleteCookie(
                Context,
                Options.PlatformName,
                context.CookieOptions);

            // Only redirect on the logout path
            var shouldRedirect = Options.LogoutPath.HasValue && OriginalPath == Options.LogoutPath;

            await ApplyHeaders(shouldRedirect, context.Properties);
        }
Ejemplo n.º 2
0
 public virtual Task SigningOut(PlatformSigningOutContext context) => OnSigningOut(context);