From c7fe58200f3a5cc34cc40e2421c55e27fac5d11c Mon Sep 17 00:00:00 2001 From: Kukks Date: Thu, 18 Mar 2021 09:38:05 +0100 Subject: [PATCH] small fixes and adjustments around btcpay auth --- .../Identity/Pages/Account/Login.cshtml.cs | 6 +- .../Manage/BTCPayAccountLink.cshtml.cs | 7 +- .../Pages/Account/Manage/_ManageNav.cshtml | 5 +- BtcTransmuter/BTCPayAuthService.cs | 87 +++++++++++++------ BtcTransmuter/Properties/launchSettings.json | 3 +- 5 files changed, 70 insertions(+), 38 deletions(-) diff --git a/BtcTransmuter/Areas/Identity/Pages/Account/Login.cshtml.cs b/BtcTransmuter/Areas/Identity/Pages/Account/Login.cshtml.cs index 93c9fab..ea13bef 100644 --- a/BtcTransmuter/Areas/Identity/Pages/Account/Login.cshtml.cs +++ b/BtcTransmuter/Areas/Identity/Pages/Account/Login.cshtml.cs @@ -137,7 +137,11 @@ public class GetCurrentUserResponse { public bool EmailConfirmed { get; set; } [JsonProperty("requiresEmailConfirmation")] - public bool RequiresEmailConfirmation { get; set; } + public bool RequiresEmailConfirmation { get; set; } + + + [JsonProperty("roles")] + public string[] Roles { get; set; } public override string ToString() { diff --git a/BtcTransmuter/Areas/Identity/Pages/Account/Manage/BTCPayAccountLink.cshtml.cs b/BtcTransmuter/Areas/Identity/Pages/Account/Manage/BTCPayAccountLink.cshtml.cs index 6485084..f01966c 100644 --- a/BtcTransmuter/Areas/Identity/Pages/Account/Manage/BTCPayAccountLink.cshtml.cs +++ b/BtcTransmuter/Areas/Identity/Pages/Account/Manage/BTCPayAccountLink.cshtml.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Net.Http; -using System.Net.Http.Headers; +using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using BtcTransmuter.Data.Entities; using BtcTransmuter.Data.Models; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; namespace BtcTransmuter.Areas.Identity.Pages.Account.Manage { diff --git a/BtcTransmuter/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml b/BtcTransmuter/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml index f657e31..31e09ae 100644 --- a/BtcTransmuter/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml +++ b/BtcTransmuter/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml @@ -8,13 +8,12 @@