Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
s8_ivanov_r
VPL-pizza-shop-blazor
Commits
9333fbd5
Commit
9333fbd5
authored
Jan 23, 2019
by
Steve Sanderson
Browse files
Handle auth failure
parent
87d42864
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
src/BlazingPizza.ComponentsLibrary/content/authPopup.js
src/BlazingPizza.ComponentsLibrary/content/authPopup.js
+1
-1
src/BlazingPizza.Server/Startup.cs
src/BlazingPizza.Server/Startup.cs
+6
-0
No files found.
src/BlazingPizza.ComponentsLibrary/content/authPopup.js
View file @
9333fbd5
...
...
@@ -7,7 +7,7 @@
}
userInfoComponent
=
component
;
var
popup
=
window
.
open
(
'
user/signin?returnUrl=
'
+
encodeURIComponent
(
location
.
href
),
'
loginWindow
'
,
'
height=600,width=45
0
'
);
var
popup
=
window
.
open
(
'
user/signin?returnUrl=
'
+
encodeURIComponent
(
location
.
href
),
'
loginWindow
'
,
'
width=600,height=60
0
'
);
// Poll to see if it's closed before completion
var
intervalHandle
=
setInterval
(
function
()
{
...
...
src/BlazingPizza.Server/Startup.cs
View file @
9333fbd5
...
...
@@ -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>"
);
};
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment