Commit 9333fbd5 authored by Steve Sanderson's avatar Steve Sanderson
Browse files

Handle auth failure

parent 87d42864
......@@ -7,7 +7,7 @@
}
userInfoComponent = component;
var popup = window.open('user/signin?returnUrl=' + encodeURIComponent(location.href), 'loginWindow', 'height=600,width=450');
var popup = window.open('user/signin?returnUrl=' + encodeURIComponent(location.href), 'loginWindow', 'width=600,height=600');
// Poll to see if it's closed before completion
var intervalHandle = setInterval(function () {
......
......@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Blazor.Server;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
......@@ -45,6 +46,11 @@ namespace BlazingPizza.Server
{
twitterOptions.ConsumerKey = Configuration["Authentication:Twitter:ConsumerKey"];
twitterOptions.ConsumerSecret = Configuration["Authentication:Twitter:ConsumerSecret"];
twitterOptions.Events.OnRemoteFailure = (context) =>
{
context.HandleResponse();
return context.Response.WriteAsync("<script>window.close();</script>");
};
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment