mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-21 22:11:48 +01:00
Rename LNUrlAuthController -> UILNAuthController (#3352)
This commit is contained in:
parent
c62018f984
commit
a8adac9c5a
8 changed files with 12 additions and 10 deletions
|
@ -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))
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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,
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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>
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue