mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 22:46:49 +01:00
Slightly big PR because I started refactoring to reduce code duplication between the UI based business logic and the api one.
28 lines
979 B
C#
28 lines
979 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using BTCPayServer.Controllers;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Routing;
|
|
|
|
namespace Microsoft.AspNetCore.Mvc
|
|
{
|
|
public static class UrlHelperExtensions
|
|
{
|
|
public static string EmailConfirmationLink(this LinkGenerator urlHelper, string userId, string code, string scheme, HttpContext context)
|
|
{
|
|
return urlHelper.GetUriByAction(context, nameof(AccountController.ConfirmEmail), "Account",
|
|
new {userId, code}, scheme);
|
|
}
|
|
|
|
public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string userId, string code, string scheme)
|
|
{
|
|
return urlHelper.Action(
|
|
action: nameof(AccountController.ResetPassword),
|
|
controller: "Account",
|
|
values: new { userId, code },
|
|
protocol: scheme);
|
|
}
|
|
}
|
|
}
|