From 0cc2fa962d56edb23e5c0f73c7ed64482ed39d77 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 7 Oct 2019 13:03:50 +0900 Subject: [PATCH] Prepare Startup.cs for netcoreapp30 --- BTCPayServer/BTCPayServer.csproj | 2 ++ BTCPayServer/Hosting/Startup.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 4952b74a0..ae4a356ac 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -211,6 +211,8 @@ $(IncludeRazorContentInPack) + + $(IncludeRazorContentInPack) diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index 9176bd785..e1fb2b6f8 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -198,7 +198,9 @@ namespace BTCPayServer.Hosting options.AllowPasswordFlow(); options.AllowAuthorizationCodeFlow(); options.UseRollingTokens(); +#if NETCOREAPP21 options.UseJsonWebTokens(); +#endif options.RegisterScopes( OpenIdConnectConstants.Scopes.OpenId, @@ -212,13 +214,19 @@ namespace BTCPayServer.Hosting RestAPIPolicies.BTCPayScopes.ViewApps, RestAPIPolicies.BTCPayScopes.AppManagement ); - +#if NETCOREAPP21 options.AddEventHandler(); options.AddEventHandler(); options.AddEventHandler(); options.AddEventHandler(); options.AddEventHandler(); - +#else + options.AddEventHandler(PasswordGrantTypeEventHandler.Descriptor); + options.AddEventHandler(AuthorizationCodeGrantTypeEventHandler.Descriptor); + options.AddEventHandler(RefreshTokenGrantTypeEventHandler.Descriptor); + options.AddEventHandler(ClientCredentialsGrantTypeEventHandler.Descriptor); + options.AddEventHandler(LogoutEventHandler.Descriptor); +#endif options.ConfigureSigningKey(Configuration); }); }