Rename LNUrlAuthController -> UILNAuthController (#3352)

This commit is contained in:
Nicolas Dorier 2022-01-25 11:51:14 +09:00 committed by GitHub
parent c62018f984
commit a8adac9c5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 10 deletions

View file

@ -257,8 +257,8 @@ namespace BTCPayServer.Controllers
RememberMe = rememberMe,
UserId = user.Id,
LNURLEndpoint = new Uri(_linkGenerator.GetUriByAction(
action: nameof(LNURLAuthController.LoginResponse),
controller: "LNURLAuth",
action: nameof(UILNURLAuthController.LoginResponse),
controller: "UILNURLAuth",
values: new { userId = user.Id, action="login", tag="login", k1= Encoders.Hex.EncodeData(r) }, Request.Scheme, Request.Host, Request.PathBase))
};
}

View file

@ -1,7 +1,9 @@
using System;
using System;
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Constants;
using BTCPayServer.Abstractions.Extensions;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Client;
using BTCPayServer.Data;
using BTCPayServer.Models;
using LNURL;
@ -16,14 +18,14 @@ using NBitcoin.DataEncoders;
namespace BTCPayServer
{
[Route("lnurlauth")]
[Authorize]
public class LNURLAuthController : Controller
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanViewProfile)]
public class UILNURLAuthController : Controller
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly LnurlAuthService _lnurlAuthService;
private readonly LinkGenerator _linkGenerator;
public LNURLAuthController(UserManager<ApplicationUser> userManager, LnurlAuthService lnurlAuthService,
public UILNURLAuthController(UserManager<ApplicationUser> userManager, LnurlAuthService lnurlAuthService,
LinkGenerator linkGenerator)
{
_userManager = userManager;
@ -71,7 +73,7 @@ namespace BTCPayServer
return View(new Uri(_linkGenerator.GetUriByAction(
action: nameof(CreateResponse),
controller: "LNURLAuth",
controller: "UILNURLAuth",
values: new
{
userId,

View file

@ -189,7 +189,7 @@ namespace BTCPayServer.Controllers
case Fido2Credential.CredentialType.FIDO2:
return RedirectToAction("Create", "UIFido2", new { name });
case Fido2Credential.CredentialType.LNURLAuth:
return RedirectToAction("Create", "LNURLAuth", new { name });
return RedirectToAction("Create", "UILNURLAuth", new { name });
default:
throw new ArgumentOutOfRangeException(nameof(type), type, null);
}

View file

@ -62,7 +62,7 @@
document.getElementById("authform").submit();
}
}
request.open("GET", @Safe.Json(Url.Action("LoginCheck", "LNURLAuth", new { userId = Model.UserId })), true);
request.open("GET", @Safe.Json(Url.Action("LoginCheck", "UILNURLAuth", new { userId = Model.UserId })), true);
request.send(new FormData());
}
check();

View file

@ -122,7 +122,7 @@
}
else if (device.Type == Fido2Credential.CredentialType.LNURLAuth)
{
<a asp-controller="LNURLAuth" asp-action="Remove" asp-route-id="@device.Id" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-title="Remove Lightning security" data-description="Your account will no longer be linked to the lightning node <strong>@name</strong> as an option for two-factor authentication." data-confirm="Remove" data-confirm-input="REMOVE">Remove</a>
<a asp-controller="UILNURLAuth" asp-action="Remove" asp-route-id="@device.Id" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-title="Remove Lightning security" data-description="Your account will no longer be linked to the lightning node <strong>@name</strong> as an option for two-factor authentication." data-confirm="Remove" data-confirm-input="REMOVE">Remove</a>
}
</div>
}