Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP-1199 - When navigating from FTS to SIRSI, you are immediately directed to the "We signed you out" timeout page #1296

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ public class DisplayLogoutMessageMiddleware(RequestDelegate next)
{
public async Task InvokeAsync(HttpContext context)
{
if (context.Request.Cookies.ContainsKey(".AspNetCore.Cookies"))
// If the request is not for the sign-in page, and the user is authenticated, and the cookie is expired,
// then sign out the user and redirect to the logged-out page.
if (context.Request.Path.StartsWithSegments("/signin-oidc", StringComparison.OrdinalIgnoreCase) == false
&& context.Request.Path.StartsWithSegments("/one-login", StringComparison.OrdinalIgnoreCase) == false
&& context.Request.Cookies.ContainsKey(".AspNetCore.Cookies"))
{
var authResult = await context.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme);

Expand Down