Exemplo n.º 1
0
        public override async Task Invoke(IOwinContext context)
        {
            AuthenticationHandler <TOptions> handler = CreateHandler();
            await handler.Initialize(Options, context);

            if (!await handler.InvokeAsync())
            {
                await Next.Invoke(context);
            }
            await handler.TeardownAsync();
        }
        public override Task Invoke(IOwinContext context)
        {
            AuthenticationHandler <TOptions> handler = CreateHandler();
            var initTask = handler.Initialize(Options, context);

            initTask.Wait();

            var handlerTask = handler.InvokeAsync();

            handlerTask.Wait();

            if (!handlerTask.Result)
            {
                Next.Invoke(context).Wait();
            }
            handler.TeardownAsync();
        }