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

move from IOptionsMonitor to IOptions #288

Merged
merged 1 commit into from
Jul 3, 2020
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 @@ -20,14 +20,14 @@ namespace Microsoft.Identity.Web.UI.Areas.MicrosoftIdentity.Controllers
[Route("[area]/[controller]/[action]")]
public class AccountController : Controller
{
private readonly IOptionsMonitor<MicrosoftIdentityOptions> _options;
private readonly IOptions<MicrosoftIdentityOptions> _options;

/// <summary>
/// Constructor of <see cref="AccountController"/> from <see cref="MicrosoftIdentityOptions"/>
/// This constructor is used by dependency injection.
/// </summary>
/// <param name="microsoftIdentityOptions">Configuration options.</param>
public AccountController(IOptionsMonitor<MicrosoftIdentityOptions> microsoftIdentityOptions)
public AccountController(IOptions<MicrosoftIdentityOptions> microsoftIdentityOptions)
{
_options = microsoftIdentityOptions;
}
Expand Down Expand Up @@ -78,7 +78,7 @@ public IActionResult ResetPassword([FromRoute] string scheme)

var redirectUrl = Url.Content("~/");
var properties = new AuthenticationProperties { RedirectUri = redirectUrl };
properties.Items["policy"] = _options.CurrentValue?.ResetPasswordPolicyId;
properties.Items["policy"] = _options.Value?.ResetPasswordPolicyId;
return Challenge(properties, scheme);
}

Expand All @@ -99,7 +99,7 @@ public async Task<IActionResult> EditProfile([FromRoute] string scheme)

var redirectUrl = Url.Content("~/");
var properties = new AuthenticationProperties { RedirectUri = redirectUrl };
properties.Items["policy"] = _options.CurrentValue?.EditProfilePolicyId;
properties.Items["policy"] = _options.Value?.EditProfilePolicyId;
return Challenge(properties, scheme);
}
}
Expand Down