Created
February 21, 2021 10:24
-
-
Save fmshk97/d897146c451f7feddbf519beaf33dea5 to your computer and use it in GitHub Desktop.
ReplaceRedirector() implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Func<RedirectContext<CookieAuthenticationOptions>, Task> ReplaceRedirector( | |
HttpStatusCode statusCode, | |
Func<RedirectContext<CookieAuthenticationOptions>, Task> existingRedirector) => context => | |
{ | |
if (context.Request.Path.StartsWithSegments("/accounts")) | |
{ | |
context.Response.StatusCode = (int) statusCode; | |
return Task.CompletedTask; | |
} | |
return existingRedirector(context); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment