Last active
April 19, 2019 17:38
-
-
Save MarneeDear/dc49d2c04cbbb61bc4162945164e301b to your computer and use it in GitHub Desktop.
Configure DataProtectionTokenProviderOptions in F# (using Saturn)
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
//How do I configure the DataProtectionTokenProviderOptions in F#? | |
//Following the guide here: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/accconfirm?view=aspnetcore-2.2&tabs=visual-studio#change-email-and-activity-timeout | |
//This is the code in C# | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.Configure<DataProtectionTokenProviderOptions>(o => | |
o.TokenLifespan = TimeSpan.FromHours(3)); | |
} | |
//This seems to work | |
let configService (services:IServiceCollection) = | |
services.Configure<DataProtectionTokenProviderOptions>(fun (o:DataProtectionTokenProviderOptions) -> o.TokenLifespan <- TimeSpan.FromHours(3.0)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment