-
Notifications
You must be signed in to change notification settings - Fork 597
Conversation
@@ -125,7 +124,7 @@ private string CurrentUri | |||
// When redeeming a 'code' for an AccessToken, this value is needed | |||
if (!string.IsNullOrWhiteSpace(Options.RedirectUri)) | |||
{ | |||
properties.Items.Add(OpenIdConnectAuthenticationDefaults.RedirectUriUsedForCodeKey, Options.RedirectUri); | |||
properties.Items.Add(OpenIdConnectAuthenticationDefaults.RedirectUriForCodePropertiesKey, Options.RedirectUri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if block can be merged with the prior one.
Replace IsNullOrWhiteSpace with IsNullOrEmpty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure enough, that was a copy paste issue.
string.IsNullOrEmpty instead of string.IsNullOrWhiteSpace
…ication => Task.FromResult(0);
If you really want to prevent a user from setting notifications to null, why not simply adding a |
Well, I don't actually. For a very busy server, handling a lot of request. Setting up for notifications that just no-op seems a waste. So I would like to start with them null and take action if the user actually hooked one. |
Awaiting a completed task (like the one returned by Do you have a benchmark confirming your feeling? |
It is not just the Task.FromResult, but the build up to make the call. We have to new up objects etc. |
Checks for whitespace are functionally incorrect in 99% of cases. That is different from doing an optimization where the functionality is identical. |
I am not sure exactly sure what you mean by functionally incorrect or how you came to 99%, but I removed the default task handler and put in a check for null since the existing API allows for the users to set the notification to null. Is there anything else blocking this PR? |
@brentschmaltz we'll finish this up next week when @Tratcher is back from vacation. |
Rebased, squashed, and merged. |
Additional Tests
Check for null RedirectToIdentityProviderNotification != null before preparing the call
Additional state can be easily set by user in RedirectToIdentityProviderNotification